Solved

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

Posted on 2011-03-09
7
839 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

939 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

11 Experts available now in Live!

Get 1:1 Help Now