Code snippets are as follows:
import os
a= "\\"
path=r"C:"+a+"Windows"+a+"System32"
print "\n path :",path
os.chdir('C:')
os.path.abspath(path)
os.chdir(path)
print os.getcwd()
os.system('PNPUTIL.exe')
Result :
path : C:\Windows\System32
C:\Windows\System32
'PNPUTIL.exe' is not recognized as an internal or external command,
operable program or batch file.
Though the utility is available its not geting identified,wat could be the problem?
path = os.path.abspath(path)
?os
but not using it to construct your path.a='\\' == os.sep
, andpath=r"C:"+a+"Windows"+a+"System32" == path=os.path.join("C:","Windows", "System32")