Running csctipt to get printer list

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Running csctipt to get printer list

Post by kpassaur » Fri Jul 07, 2006 10:02 am

I am trying to get a list of active printers and put them in a drop down list. The plan is to use

cscript prnmngr.vbs -l >c:\printerdetails.txt

This command if run from the command line (XP or NT users), provided you are in c:\window\system32 generates a text file that can easily be parsed into a list for my drop down menu.

However, if I use

Change Directory>C:\WINDOWS\system32
/Let>RP_WAIT=1
/Let>RP_WINDOWMODE=0
Run Program>cscript prnmngr.vbs -l >c:\printerdetails.txt

It does not generate the list and when I step through it using F8 I see a result of 33 which is not in the help file as to what kind of error it is. However it works from the command line

I am assuming that there maybe a difficulty with running cscript from MS. Has anyone tried something like this in the past or know of an easy way to get a list of printers?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jul 07, 2006 10:56 am

Do this instead:

Code: Select all

Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Run Program>cmd /c cscript %SYS_DIR%\prnmngr.vbs -l >c:\printerdetails.txt
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Printer list

Post by kpassaur » Fri Jul 07, 2006 11:00 am

Thanks Marcus, I had just figured out the cmd portion but I didn't know I could use %SYS_DIR% which is really neat

Thanks

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts