Can we pass an argument when we run a macro from the command line? If so how?

I have a requirement to pass few arguments to ER Studio macro by calling through the command line. Please let me know if it is possible? If so, please provide a snippet.

  • You cannot pass parameters via the command line directly, but it is easy to use environment variables.

    Create a batch file as follows:

    set MyParam=here is my parameter
    "C:\Program Files (x86)\Embarcadero\ERStudio Data Architect 16.0\ERSTUDIO.exe" -m "C:\ProgramData\Embarcadero\ERStudioDA_2016\Macros\test.BAS"


    Then create a Test.bas macro:

    Sub Main
    MsgBox Environ("MyParam")
    End Sub


    Run the batch file and you will get a message box with the text "here is my parameter".