selecting files by command line

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
LaurentO
New Member
Posts: 4
Joined: Wed Mar 05, 2014 3:22 am

selecting files by command line

Post by LaurentO »

Hi
Can you tell me how I can Select 2 files for compare by using the command line.
Each file should be selected separately.
I want to use it to compare 2 files in MY PHP IDE. In fact I want to reproduce the context menu options : select first file... and compare to...

thanks for your help
User avatar
psguru
Site Admin
Posts: 2228
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: selecting files by command line

Post by psguru »

When the first file is selected, it is recorded in HKEY_CURRENT_USER\Software\PrestoSoft\ExamDiff Pro\Shell under "First File to Compare" value.
psguru
PrestoSoft
LaurentO
New Member
Posts: 4
Joined: Wed Mar 05, 2014 3:22 am

Re: selecting files by command line

Post by LaurentO »

thanks but that does not answer to my problem

Is there a posibility to select a file first using the command line (my IDE (phpStrom) can handle command line tools) and to compare it later to a second selected file using another command (as I said that is the same principe that used by the context menu options added by examdiff ) ?
thanks
User avatar
psguru
Site Admin
Posts: 2228
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: selecting files by command line

Post by psguru »

The answer I gave should provide you with an idea how the EDPro Shell extension works. There's no way to do this directly from the command line. The approach should be to record your first selected path somewhere (e.g. the Registry), then use the second command to obtain the second path and use the first recorded path to perform the comparison.
psguru
PrestoSoft
LaurentO
New Member
Posts: 4
Joined: Wed Mar 05, 2014 3:22 am

Re: selecting files by command line

Post by LaurentO »

ok, I'll try to do with that
thanks a lot for your quick answer
LaurentO
New Member
Posts: 4
Joined: Wed Mar 05, 2014 3:22 am

Re: selecting files by command line

Post by LaurentO »

I found a solution by using a temporary session file
I use 2 batch files, first one to store the first file name and the second one to store the second file name and launch the program.

These are the 2 DOS files I use :

The first one, must by launched first :

Code: Select all

@echo off
rem Permet d'enregistrer les paramètres pour permettre la comparaison de 2 fichiers avec examdiff pro
rem Enregistre uniquement le 1er fichier passé en paramètre à la commande
rem 
rem Saves the settings to allow the comparison of two files with ExamDiff Pro
rem Saves only the first file passed as a parameter to the command
rem 
rem exemple d'utilisation:
rem usage:
rem 1_file1.bat c:\fichier1.php 

set filename=%temp%\examdiff.edpi

echo [General]>%filename%
echo Version=6.0>>%filename%
echo Cookie=BF31A13F-48C2-4d4d-B59C-4190401EAC5D>>%filename%
echo Session=PHPstrom>>%filename%
echo [Session]>>%filename%
echo File 1=%1>>%filename%
and the second one,

Code: Select all

@echo off
rem Permet de lancer la comparaison de 2 fichiers enregistrés dans une session préalable par examdiffpro
rem Enregistre le 2e fichier passés en paramètre à la commande puis lance examdiffpro pour faire la comparaison
rem 
rem Starts the comparison of 2 files saved in a prior session using examdiffpro
rem Stores the second file passed as a command line parameter then launches examdiffpro for comparison
rem
rem exemple d'utilisation:
rem usage:
rem 3b_file2_start.bat c:\fichier2.php 

set filename=%temp%\examdiff.edpi
set cmd="C:\Program Files\ExamDiff Pro\ExamDiff.exe"

echo File 2=%1>>%filename%
start "examdiff" %cmd% /sf:%filename% 
rem del %filename%
exit
Post Reply