Sign in to follow this  
Followers 0
Rishav

Comparing files in Winmerge

4 posts in this topic

Hi folks

I was trying to open some files in winmerge. Now the command line syntax for winmerge is something like

winmerge "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. :D

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 regards

Rishav

Share this post


Link to post
Share on other sites



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?

Share this post


Link to post
Share on other sites

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... :D

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. :D

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0