Jump to content

passing dynamic commandline switches to compiled script?


GoogleDude
 Share

Recommended Posts

I have a script that has a few different func() in it. the func() have $vars that are used but the vars will be set at runtime when the compiled script is run.

an example is

C:\mycompiledscript.exe /staticswich:dynamicvalue /staticswich:dynamicvalue

the dynamicvalue word would be replaced with what every I want the vars to be set as so they can be used inside the script. If that makes sense.

my code sample Im using to try yo debug it is below.

If $CMDLINE[0] And $CMDLINE[1] = '/filename:' And $CMDLINE[2] = '/emailaddress:' Then
    ; msg command line switches passed for debugging
    MsgBox(48,"",$CMDLINE[1]&" "&" "&$CMDLINE[2])
    ; call what ever function
EndIf
Exit

~GD

Link to comment
Share on other sites

  • Developers

Does this help ? http://www.autoitscript.com/forum/index.php?showtopic=59773&view=findpost&p=452254

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...