Jump to content

Recommended Posts

Posted

Is using system variables like %systemdrive% in AutoIt possible?

I tried something like this but it didn't work.

Run("%systemdrive%\ABC\abc.exe")


Posted

You have to put AutoItSetOption("ExpandEnvStrings",1) in your script

it defaults to 0.

Posted

Use the following...

@WindowsDir...C:\Windows

@SystemDir...C:\Windows\System32

*EDIT* Corrected. Thanks for input. Yes - see help files as many more exist.

Posted

Actually :(

C:\ = @HomeDrive

C:\Windows = @WindowsDir

C:\Windows\System or C:\Windows\System32 = @SystemDir

There 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" )

Posted

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.

Posted

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")

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...