I've tried WMIC and the (goto) trick so far. WMIC, I have no idea how I would trace a ParentProcessID etc. to a file name and path even if I got it, but maybe I'm missing something. Meanwhile (goto) seems useless; I know how to find the parent if my script was CALLED, but it's all one call stack when the script is simply RUN. I know there's some wizards posting here, does anyone have any definitive information about whether this is even possible, or what approaches could be taken to do it? I will take any help I can get.
p.s., to me this distinction is clear, but just in case,
Code: Select all
@ECHO OFF
:: this is the "run" I'm hoping I can find the caller from
"C:\MY PATH\MYSCRIPT.BAT"
:: this one I already know how to find the caller from
CALL "C:\MY PATH\MYSCRIPT.BAT"
thanks for reading!