October 27, 200421 yr Is using system variables like %systemdrive% in AutoIt possible?I tried something like this but it didn't work.Run("%systemdrive%\ABC\abc.exe")
October 27, 200421 yr You have to put AutoItSetOption("ExpandEnvStrings",1) in your scriptit defaults to 0.
October 27, 200421 yr Use the following... @WindowsDir...C:\Windows @SystemDir...C:\Windows\System32*EDIT* Corrected. Thanks for input. Yes - see help files as many more exist.
October 27, 200421 yr 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" )
October 27, 200421 yr 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.
October 27, 200421 yr 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")
October 27, 200421 yr hmmm couldn't one also do it like so-RunWait(@ComSpec & " /c start %systemdrive%\ABC\abc.exe", "", @SW_HIDE)
Create an account or sign in to comment