1.

Solve : Help fine tuning a batch file?

Answer»

im having trouble SETTING my default printer depending on the ip address of my machines. Below is the code i have so FAR and i was wondering if anyone new where i was going wrong.


@echo off
if %ip%==192.168.32.144 RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n "A4 Black & White"Man, what is the error message?it doesnt have an error message, it just wont assign the printer as default, but if i run the default printer code WITHOUT the if statement it will assign the printer.Common sense TELLS you that if the code runs without the IF and does not run with the IF, then the IF CONDITION is never true. Where did %ip% come from and how was it's value derived? Hint: you can echo %ip% and check it's value.

Let us know.



Discussion

No Comment Found