What I have tried? In the former link given in the question and I have tried executing it and I get Process Name,Process Locations and process ID. And I referred the internet and modified the script given in the popular answer of SO Q1 and modified like this
class GetProcess:
def __init__(self):
cmd = 'WMIC PROCESS get Commandline'
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
for line in proc.stdout:
print(line)
when I am executing the script I get locations with weird data like this
b'"C:\Program Files\WindowsApps\Microsoft.Windows.Photos_17.214.10010.0_x64__8wekyb3d8bbwe\Microsoft.Photos.exe" -ServerName:App.AppXzst44mncqdg84v7sv6p7yznqwssy6f7f.mca
Is there any way to get the location alone instead of getting what is running what?
I can see that this can be done using with some third party libraries but I need to know whether there is any solution which I can get the process without any third party library