I run this code:
source_path="c:\temp\\"
dest_path="c:\\temp2\\"
for Name in UserNames:
run_win_cmd("robocopy "+ source_path + Name + "* "+ dest_path)
Name in UserNames gives a name like JBlackstone, and I get the following:
b'ERROR : Invalid Parameter #2 : "emp\\Flastone*"\r\n'
Complete with the b'. No matter how I seem to format the backslashes for the command line, it ends up wrong. Here it read \temp
as tab emp. If I double backslashes \\temp\\
to the \, it puts in double backslashes. If I don't it reads them as formatting chararcters. I am using run_win_cmd
to call the code.
Suggestions would be much appreciated.