kyuuzo Posted October 27, 2004 Posted October 27, 2004 Is using system variables like %systemdrive% in AutoIt possible?I tried something like this but it didn't work.Run("%systemdrive%\ABC\abc.exe")
jbm Posted October 27, 2004 Posted October 27, 2004 You have to put AutoItSetOption("ExpandEnvStrings",1) in your scriptit defaults to 0.
MHz Posted October 27, 2004 Posted October 27, 2004 Or you canRun(EnvGet('systemdrive') & '\ABC\abc.exe')
dcrowder32 Posted October 27, 2004 Posted October 27, 2004 Use the following... @WindowsDir...C:\Windows @SystemDir...C:\Windows\System32*EDIT* Corrected. Thanks for input. Yes - see help files as many more exist.
Nologic Posted October 27, 2004 Posted October 27, 2004 Actually C:\ = @HomeDriveC:\Windows = @WindowsDirC:\Windows\System or C:\Windows\System32 = @SystemDirThere is a huge list of them in the help file...look under "Macro Reference"Any ways your sample code would look like so:Run( @HomeDrive & "\ABC\abc.exe" )
SiMoNsAyS Posted October 27, 2004 Posted October 27, 2004 this isn't a help for the autoit script but to left it clear just open your command prompt (cmd.exe from run dialog for example) and then type "SET" without quotes to see the variables available.note: some of them like %APPDATA% won't be available until windows is fully installed so don't use them on cmdlines.
edmoncu Posted October 27, 2004 Posted October 27, 2004 you can use standard autoit variables when windows has already set up...however, during windows installation, you cannot use autoit built-in variables (like @HOMEDRIVE, etc...), but you're only restricted to declare variables.. like:$sysdrive=EnvGet("SystemDrive").........RegWrite($Key&"\001", "", "REG_SZ","Preparing Installation...")RegWrite($Key&"\001", "1", "REG_SZ",$sysdrive&"\Others\prepare.exe")
Nologic Posted October 27, 2004 Posted October 27, 2004 hmmm couldn't one also do it like so-RunWait(@ComSpec & " /c start %systemdrive%\ABC\abc.exe", "", @SW_HIDE)
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now