I have a python script to install/uninstall some regularly used programs for me and it also does some shortcut/folder clean up after uninstall. I used to use this code to delete a folder
os.system('rd /S /Q "{0}\\{1}"'.format(dirname, name))
which worked just fine. I am attempting to convert my usage of os.system
to subprocess.call
so I changed the above line to this
subprocess.call(['rd', '/S', '/Q', '{0}\\{1}'.format(dirname, name)])
but this gives the error
The system cannot find the file specified (2)
I must be using subprocess.call incorrectly but I can't work it out. Any help would be appreciated, thanks.