windows - Powershell how to get "Start In" information for process started by shortcut -
i have process started desktop shortcut. desktop shortcut has information in "start in" field. "start in" information process. possible? how using powershell?
i have looked @ properties returned get-process , get-wmiobject win32_process cannot seem find can find "start in" information. tia
update
the reason need information have couple of programs ran python. have shortcuts setup start these. shortcut target is:
python.exe my_script.py however, there couple of versions of my_script.py on computer, none of on path. set "start in" property of shortcut control version of my_script.py executed.
i realize there other ways change tell script version running, i'm trying not make changes existing setup, , write powershell script information.
if desktop shortcut has predictable file name, shortcut.lnk, maybe helps?
$lnkpath = get-childitem .\shortcut.lnk | select -expand fullname $wsh = new-object -com wscript.shell $wsh.createshortcut($lnkpath).workingdirectory
Comments
Post a Comment