Jump to content

Macros in Command Line


Recommended Posts

Hi,

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

Link to comment
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

CheersNobby

Link to comment
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
 Share

  • Recently Browsing   0 members

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