Rishav Posted September 17, 2009 Posted September 17, 2009 Hi folksI was trying to open some files in winmerge. Now the command line syntax for winmerge is something likewinmerge "C:\Documents and Settings\rishavs\Desktop\Book1.txt" "C:\Documents and Settings\rishavs\Desktop\Book1.txt"I dont really want invoke winmerge silently, so instead of opening a command window, i tried shellexecute. Problem is how do i send the double quotes to the shell execute? Double quotes are interpreted by Autoit as its own command character. Anyway the code that i'd like is$File1 = FileOpenDialog("Select","", "txt (*.txt)") $File2 = FileOpenDialog("Select","", "txt (*.txt)") shellexecute("winmerge " & $File1 & " " & $File2) ; winmerge "C:\Documents and Settings\rishavs\Desktop\Book1.txt" "C:\Documents and Settings\rishavs\Desktop\Book2.txt"Any ideas?thanks and regardsRishav
jvanegmond Posted September 17, 2009 Posted September 17, 2009 ShellExecute requires the second parameter to be the parameters for the process. To place a " in a string do this: $a = "Quote: ""I am afraid of clowns""." So your function becomes: ShellExecute("winmerge", """" & $File1 & """ """ & $File2 & """") Why can't you use run by the way? github.com/jvanegmond
Rishav Posted September 17, 2009 Author Posted September 17, 2009 ShellExecute requires the second parameter to be the parameters for the process. To place a " in a string do this: $a = "Quote: ""I am afraid of clowns""." So your function becomes: ShellExecute("winmerge", """" & $File1 & """ """ & $File2 & """") Why can't you use run by the way? ooooo works... I didnt want to use run is because i didnt want to point it to winmerge's exe. I need my code to work on different computers. if i type winmerge in the run command field (win+R) it worked perfectly. stupid justification, i know. but seemed like the most hasslefree way to do it. thanks for the pointer. ps. I am totally not afraid of clowns. Bears, though are a different matter altogether.
jvanegmond Posted September 17, 2009 Posted September 17, 2009 You can just do Run("winmerge") and it works.. Try out Run("notepad") You honestly use ShellExecute way too much. 8) github.com/jvanegmond
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