Jump to content

Exit script when no command line parameter is given


Chetwood
 Share

Recommended Posts

Apparently I can't see the forest for the trees so maybe someone of you can help me out. I have a little script that among other things opens the cd tray when a drive letter is given as a command-line parameter. "myscript.au3 e" would open drive e. But how do I make the script exit immediately when it is started without any parameter?

If $CmdLine[0] Then 
Exit
Else
do fancy stuff
EndIf
Exit

does still execute "do fancy stuff" instad of stopping immediately. TIA.

MultiMakeMKV: batch processing for MakeMKV (Win)MultiShrink: batch processing for DVD ShrinkOffizieller Übersetzer von DVD Shrink deutsch
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...