Jump to content
Sign in to follow this  

Macros in Command Line

Recommended Posts



Anyone who had used macros in Command Line, example:

C:\Test.au3 @ProgramFilesDir

In the AutoIT script Test.au3 $CommandLine[1] has the value "@ProgramFilesDir" instead of "C:\Program Files".

Is it possible to convert the value "@ProgramFilesDir" in $CommandLine[1] to a macro @ProgramFilesDir?

I have tried the functions Eval() and Assign().

I would be thankfull for some hints.....

Best Regards

Jan Fredsholt

Share this post

Link to post
Share on other sites

I don't think you can use a macro outside the script.

If you use the windows environment variables it can work as long as the variable include " " if there is a space.

So the env variable for Program Files is ProgramFiles, which returns the value c:\program files.

c:\test.au3 %ProgramFiles% would return the value c:\program but

c:\test.au3 %windir% will return c:\windows


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this