I am making a python script to extract files on mass which are stored in sub folders. The whole script works fine except when I pass the command to the system using os.system()
command = '"C:\\Program Files (x86)\\unrar\\unrar.exe" x ' + '"' + ch_dir + "\\" + File + '"' + ' "' + OrigDir + '\\"' print "\n" + command + "\n" os.system(command)
print command gives me:
"C:\Program Files (x86)\unrar\unrar.exe" x "C:\Users\Core\Desktop\testing folder\LAWL\MO_to_test_success.rar" "C:\Users\Core\Desktop\testing folder\"
which when I copy and paste into the command prompt works fine and extracts said file, but when used with the os.system() gives me the following error:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
I am sure it is something very simple however I am very new to this and I can't seem to solve it. I'm still developing that programmer mind-set :)
Thanks for any advice.