Sign in to follow this  
Followers 0
kpu

Startup Commands

5 posts in this topic

I can't find anything on this, but maybe I'm a blind bastard...

Is there a way to send switchs to your auto it program to do cerntain things.

So if you did. "myprog.exe /?" You would get a help message box?

Or something like "myprog.exe /input"

If $prog_switch = "/input" then
;Do this
Else
;Do this
Endif

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If $CmdLine[0]  > 0 Then
    If $CmdLine[1] = "/?" Then
        MsgBox(0,"Help", "example of command line params")
    EndIf
EndIf

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks for the quick response!

My program is called "Member_test.exe"

With you code, I would shell this command "Member_test.exe /?" to get the messagebox?

If so, it's not working for me.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for the quick response!

My program is called "Member_test.exe"

With you code, I would shell this command "Member_test.exe /?" to get the messagebox?

If so, it's not working for me.

Should do.. this is from one I used to copy one folder to another sending the 2 directories from the command line.

If $cmdline[0] = 2 Then
    $DirSearch = $cmdline[1]
    $Destination = $cmdline[2]
    StartCopy ($DirSearch,$Destination)
Else
    MsgBox(0,'Invalid # of parameters!',$cmdline[0]&' is an Invalid number of parameters.')
    Exit
EndIf

so i would type DirCopy.exe D:\start D:\End

this would send the 2 folder names to the function startcopy()

I think I had issues when my program name was too long, try renaming your program to 8chr length name

Edited by ChrisL

Share this post


Link to post
Share on other sites

Thanks Guys! I was trying to do this from a DOS window and it wasn't working so I created a "Windows" shortcut and added the switch to it. It now works great!

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  
Followers 0