haggiss Posted September 13, 2005 Posted September 13, 2005 (edited) Wondering if someone could give me a hand with basic variables. I'm basically looking to create a user prompt that will ask for a numeric value up to 4 digits. It would then prompt the user to obtain a yes or no value for default printer. It would use the above information to launch one of two command line's to install printers via command prompt. If this is in the wrong location, my apologies. The numeric value entered by the user would fill the 'bolded' number below. ThanksRUN ("Y:\BATCH\nipp.exe")WinWaitActive("Novell iPrint Client Setup")SEND ("!n"); Delays the execution of the !F long enough for client to complete installOpt("WinWaitDelay", 9000)WinWaitActive("Novell iPrint Client Setup")SEND ("!f"); Need to add the variables ?? ; Enter the numbers after RP in your printer name. (Example RP0004 would be 0004); Would you like this to be your default printer, YES or NORUN ("C:\WINNT\SYSTEM32\iprntcmd.exe http://www.xxx.xxx/ipp/RP0004 /add") Edited September 13, 2005 by haggiss
MHz Posted September 14, 2005 Posted September 14, 2005 RUN ("Y:\BATCH\nipp.exe")WinWaitActive("Novell iPrint Client Setup")SEND ("!n"); Delays the execution of the !F long enough for client to complete installOpt("WinWaitDelay", 9000)WinWaitActive("Novell iPrint Client Setup")SEND ("!f"); Need to add the variables ??; Enter the numbers after RP in your printer name. (Example RP0004 would be 0004)$name = InputBox('Select Printer name', 'Example: 0004', '0000')If Not @error Then RUN ("C:\WINNT\SYSTEM32\iprntcmd.exe http://www.xxx.xxx/ipp/RP" & $name & " /add") ; Would you like this to be your default printer, YES or NO If MsgBox(4 + 32, 'Set Default Printer', 'Would you like this to be your default printer') = 6 Then ; ?? Command to set default printer ?? EndIfEndIfYou could replace Opt("WinWaitDelay", 9000) with Sleep(9000) ?The $name variable will store the value returned by the Inputbox. If Cancel is pressed, then @error will result and the If block will not be processed.You may need to add a command to set your default printer?
haggiss Posted September 14, 2005 Author Posted September 14, 2005 MHz,Thanks for your assistance. Very much appreciated. It certainly got me started, i'm thinking I may need a second variable for the YES or NO option. I'm also wondering if it makes more sense for it to go above the enter number variable. There are two different command line variables depending whether or not we want it to install, or install as default.Run(@ComSpec & " /c " & @SystemDir & "\iprntcmd.exe http://www.iprint.xxx.xxx/ipp/RP" & $name & " /add /default")or Run(@ComSpec & " /c " & @SystemDir & "\iprntcmd.exe http://www.iprint.xxx.xxx/ipp/RP" & $name & " /add ")I've updated this script with your suggestion as well as a few check variables at the beginning. At the moment it, you enter the variable it launches the dos commmand then promts for yes or no. then attempts to execute the default command depending if you choose yes. Ideally if it obtained the yes/no value, then asked for the printer number.. it could use that data to execute only the correct command. Anyways, back at it.. so thanks so much for you assistanceThis are the checks im adding in at the beginning:If Not (@OSVersion == "WIN_2000") And Not (@OSVersion == "WIN_XP") Then ExitEndIf; Exit immediately if running within CitrixIf FileExists("T:\WINNT\explorer.exe") Then ExitEndIfIf FileExists("y:\batch\nipp.exe") Then ; continue scriptElse MsgBox(48, "ATTENTION - Fatal Error", "Cannot locate Y:\Batch\nipp.exe." & @LF & @LF & "Please call the Help Desk x34357") ExitEndIf
MHz Posted September 15, 2005 Posted September 15, 2005 i'm thinking I may need a second variable for the YES or NO option.<{POST_SNAPBACK}>Another variable would not be required. Just add Else to the condition.RUN ("Y:\BATCH\nipp.exe")WinWaitActive("Novell iPrint Client Setup")SEND ("!n"); Delays the execution of the !F long enough for client to complete installOpt("WinWaitDelay", 9000)WinWaitActive("Novell iPrint Client Setup")SEND ("!f"); Need to add the variables ??; Enter the numbers after RP in your printer name. (Example RP0004 would be 0004)$name = InputBox('Select Printer name', 'Example: 0004', '0000')If Not @error Then ; Would you like this to be your default printer, YES or NO If MsgBox(4 + 32, 'Set Default Printer', 'Would you like this to be your default printer') = 6 Then RUN ("C:\WINNT\SYSTEM32\iprntcmd.exe http://www.xxx.xxx/ipp/RP" & $name & " /add /default") Else RUN ("C:\WINNT\SYSTEM32\iprntcmd.exe http://www.xxx.xxx/ipp/RP" & $name & " /add") EndIfEndIfGood luck
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now