bboere Posted December 7, 2005 Posted December 7, 2005 I have downloaded and started to use this nifty tool. What an awesome utility!!!! I am trying to get an application to launch so I can have it run automatically. On the command line for the app, there is a variable that is entered to gather an environment variable and use this data. (It is a workstation naming utility) Here is the script that I have so far: Run("c:\windows\zmg\Zcnclite.exe /log:c:\windows\zmg\zcnc.log /remzen /sn: %WSOldName%") WinWaitActive("ENGL Zcnc Lite 1.3 [build 1307]","Please enter new computer name.") Send("{ENTER}") If I run the exact command from the command prompt or batch file, everything works properly. When the application runs (successfully), it comes up with a window with the data of the environment variable WSOldName When I run it with this script the window comes up with WSOldName for the data. How do I get this to run? Thanks in advance for any suggestions and help Brian
MCT Posted December 7, 2005 Posted December 7, 2005 try this Run('"c:\windows\zmg\Zcnclite.exe" /log:c:\windows\zmg\zcnc.log /remzen /sn: %WSOldName%')
Danny35d Posted December 7, 2005 Posted December 7, 2005 (edited) if WSOldName is an environment varible and you want to used %WSOldName% then you will need this line at the beginging of your script Opt("ExpandVarStrings", 1) ;0=don't expand, 1=do expand this option allows you to use %environment% variables inside strings. or you can use this other line:Run("c:\windows\zmg\Zcnclite.exe /log:c:\windows\zmg\zcnc.log /remzen /sn: " & EnvGet("WSOldName")) Edited December 7, 2005 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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