Solved

PDFCreator script to see what user is printing and place them in a specific folder

Posted on 2011-03-09
7
836 Views
Last Modified: 2012-06-27
Hi, I'm using PDFCreator to print my documents as PDF's. But I got a lot of users, and each PDF made by a users needs to be stored automaticly in a different folder.

e.g. User = Frank
it needs to be stored in c:\Files\Lectors\Frank

User = Kristof
it needs to be stored in C:\Files\User\Kristof

Can this be done with a .vbs script? I've tried making multiple printers of PDFCreator but it failed.
I would appreciate this.
0
Comment
Question by:Silencer001
  • 5
  • 2
7 Comments
 
LVL 8

Expert Comment

by:jawa29
ID: 35082823
Hi Silencer001

Do you have a way to distinguish the difference between a User and a Lector?

PDFCreator has an Autosave facility that can be enabled via the options page. However it can also be set via the registry.

Keys can be found under HKEY_CURRENT_USER\Software\PDFCreator\Program

UseAutoSave = 1
AutoSaveDirectory = C:\Files\User\Frank
AutoSaveFilename = <DateTime>

I believe you can achieve what you are asking by setting these keys as above on logon.

I have included a simple registry editing script that will set the above values. If you can distinguish between a User and a Lector then you could write a section before this to determine where the files will be saved to.

Jawa29

Const HKEY_CURRENT_USER = &H80000001

Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

sKeyPath = "SOFTWARE\PDFCreator\Program"
sValueName = "UseAutoSave"
sValue = "1"
oReg.SetStringValue HKEY_CURRENT_USER, sKeyPath, sValueName, sValue

sValueName = "AutosaveDirectory"
sValue = "C:\Files\User\Frank"
oReg.SetStringValue HKEY_CURRENT_USER, sKeyPath, sValueName, sValue

sValueName = "AutosaveFilename"
sValue = "<DateTime>"
oReg.SetStringValue HKEY_CURRENT_USER, sKeyPath, sValueName, sValue

Open in new window

0
 

Author Comment

by:Silencer001
ID: 35083230
Hi Jawa29

The Autosave facility doesn't work. When I save it, in PDFCreator itself, it just changes itself back. And when I use regedit to change the there, it doesn't update.

They need to login through SAP, so don't think that the usergroups can be read out of it.
But I was thinking about making an array with all the users who belong to Lector and all the ones who belong to User.

But my programming in vbscript isn't as good as I thought, so that's why I'm asking here.

I'm going to try your registry editing script now, and I'll edit this if it works or not.
Thank you for your fast response.

Silencer001
0
 

Author Comment

by:Silencer001
ID: 35083270
The registry editor script works, but due to some strange reason, the PDFCreator doesn't use these settings. Don't know why, I've already added a question on there site, a couple of days ago, but no response.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 8

Expert Comment

by:jawa29
ID: 35083363
Hi Silencer001

I have just installed PDFCreator on a test PC and run the PDFCreator1.2.0 installer. Before opening up the PDF printer or trying to use it I applied my VBScript.

All worked, outputted a PDF to C:\Files\User\Frank. Even created the folder for me!

Jawa29
0
 

Author Comment

by:Silencer001
ID: 35083371
I've found out what's wrong with PDFCreator. Need to go back to version 1.1.0 instead of using 1.2.0. Now it works.
0
 

Accepted Solution

by:
Silencer001 earned 0 total points
ID: 35083395
Instead of making a VBScript, what will automaticly change the settings of the printer. I've made multiple printers, each printer has a different folder to save the files in.

But the profiles, I neaded to create, weren't saved. But by downgrading to PFDCreator 1.1.0, it works. Guess it's a bug of the new version, found a couple of others who had the same problem.

Thank Jawa29
0
 

Author Closing Comment

by:Silencer001
ID: 35178892
Did what I wanted to do
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now