gcue Posted August 16, 2016 Posted August 16, 2016 hello i am using this line to copy files $command = ' /AutoIt3ExecuteLine "Exit(FileCopy(''' & $master_sorted_array[$x][0] & ''', ''' & $target_dir & '''))"' RunWait(@AutoItExe & $command) however i am coming across a problem when the file path contains a single quote any idea how to get around that? thank you in advance!
AutoBert Posted August 16, 2016 Posted August 16, 2016 Use Consolewrite($command&@crlf) and you see what's wrong in scite console.
gcue Posted August 16, 2016 Author Posted August 16, 2016 it is definitely the single quote found in file paths bc that's where i get a parsing error
gcue Posted August 16, 2016 Author Posted August 16, 2016 i am also trying to FileRecycle some files same issue of course.. here are the output messages... consolewrite Quote /AutoIt3ExecuteLine "Exit(FileRecycle('C:\Users\Smith\Desktop\New folder1\m's pics\20151229_160630 - Copy.jpg'))" error Quote Exit(FileRecycle('C:\Users\Smith\Desktop\New folder1\m's pics\20151229_160630 - Copy.jpg')) Exit(FileRecycle('C:\Users\Smith\Desktop\New folder1\m's pics^ERROR Error: Unable to parse line.
Developers Jos Posted August 16, 2016 Developers Posted August 16, 2016 mmm 2000+ posts and still looking for the basics. Exit(FileRecycle("C:\Users\Smith\Desktop\New folder1\m's pics\20151229_160630 - Copy.jpg")) 1 hour ago, gcue said: it is definitely the single quote found in file paths bc that's where i get a parsing error Show the content of the variable so I can see what it contains. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Danyfirex Posted August 16, 2016 Posted August 16, 2016 Hello. This should work. Local $command = ' /AutoIt3ExecuteLine "Exit(FileCopy(' & _Quoted($master_sorted_array[$x][0]) & ',' & _Quoted($target_dir ) & '))"' RunWait(@AutoItExe & $command) Func _Quoted($sString) Return '""' & $sString & '""' EndFunc ;==>_Quoted Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
gcue Posted August 16, 2016 Author Posted August 16, 2016 14 minutes ago, Danyfirex said: Hello. This should work. Local $command = ' /AutoIt3ExecuteLine "Exit(FileCopy(' & _Quoted($master_sorted_array[$x][0]) & ',' & _Quoted($target_dir ) & '))"' RunWait(@AutoItExe & $command) Func _Quoted($sString) Return '""' & $sString & '""' EndFunc ;==>_Quoted Saludos genius idea! works great! muchas gracias!
Danyfirex Posted August 16, 2016 Posted August 16, 2016 You're wellcome(De nada) Saludos kcvinu 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
gcue Posted August 16, 2016 Author Posted August 16, 2016 22 minutes ago, Jos said: mmm 2000+ posts and still looking for the basics. Exit(FileRecycle("C:\Users\Smith\Desktop\New folder1\m's pics\20151229_160630 - Copy.jpg")) Show the content of the variable so I can see what it contains. Jos i dont think its basic at all. there's a mix and possibility of single and double quotes and i wanted to make sure i was able to capture the possibilities.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now