Solved

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

Posted on 2011-03-09
7
850 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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…

730 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