Jump to content

Comparing files in Winmerge


Rishav
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...