I have a script.
If call from cmd console, the error is displayed. However if call by clicking from explorer I want to pause it so the user has a chance to read the error before the window closes.
Is there a way to know wether the script was call from cmd console or from windows explorer?
Thanks,
Jes
You can look at
%cmdcmdline%which will be something along the lines ofwhen started from Explorer.
In fact, unless your batch file runs
cmdyou should be able to rely on that the variable never contains the full path to the batch file unless started via theopenverb (which is what Explorer does; but so do a few others, e.g. Far Manager or PowerShell).