How to get the name of calling bat script
问题 I need to have my 2.bat script behaviour depending on the name of calling script. Scenario: 2.bat is invoked from many other external scripts, which I am not entitled to change. Only 2.bat is under my thumb. 1.bat : ... call 2.bat 2.bat : ...here place something extracting "1.bat"... 回答1: As you cant change the calling bat there will be almost impossible to get its name if it is triggered through the cmd console (may be a memory dump could help?) as then the ProcessId will hold information