Solved

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

Posted on 2011-03-09
7
844 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

17 Experts available now in Live!

Get 1:1 Help Now