1.

Solve : Scripting questions?

Answer»

Not REALLY a DOS question but a scripting one.

I am WRITING a small script to automate some things around the office and i'm stuck on one part. What I want the script to do is parse a variable into the COMMAND below:

rundll32 printui.dll,PrintUIEntry /in /q /n

The variable needs to be a \\printerserver\printer. It works okay if I use %1 and just start the batch file with the variable BEHIND it but I'd rather have it prompt for the printerserver/share name. I tried doing a "set /p %printer%=" but that doesn't seem to work, the command executes blank w/ the "%printer%" variable after the "/n" in the command. Any help? All of the clients this will be ran on are XP and 2K.
Code: [Select]set /p printer=Please enter server\share name:
rundll32 printui.dll,PrintUIEntry /in /q /n%printer%

Change the prompt as needed. Wasn't sure if the printer name abuts the /n switch, if not add a space between /n and %printer%.

Good luck. 8-)I'm a fool, I figured it out right after posting this. When I was doing the set command I put "%printer%" instead of "printer" which is why the var wasn't working. Stupid me!



Discussion

No Comment Found