Conditional PAUSE (not in command line)

后端 未结 3 1057
栀梦
栀梦 2020-12-14 03:16

I like to have a final PAUSE in my *.bat scripts so I can just double click on them in Windows explorer and have the chance to read the output. However, the fin

3条回答
  •  既然无缘
    2020-12-14 04:01

    I doubt that there's a distinction, because I think it just starts a command prompt and then runs the bat when you double click on it.

    However, if you make shortcuts to the bat files and go to Properties and add in an extra argument (something like "/p") in the "Target" field, then you could check for the presence of that argument at the end of the script and pause if it is set. Then, running from the shortcut would cause it to end in a pause and running from command line wouldn't.

提交回复
热议问题