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?
Running csctipt to get printer list
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Printer list
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
Thanks