![]() Sometimes, even comparing the content of the clipboard with a file on disk. There are a lot of beautifier sites available online.As developers, we often need to compare two files to find the differences. Please note that if file name does not exist in the location, it will not open the comparer.Īlso you can beautify the file before you do the comparison. Ignore the switch /m if you need just comparison.Įxample 1: vsdiffmerge test1.js test2.js test1.js output.js /t /mĮxample 2: vsdiffmerge.exe "C:\Users\livingston\Downloads\wa\wa\Files\pre\Test.js" "C:\Users\livingston\Downloads\wa\wa\Files\Prod\Test.js" "C:\Users\livingston\Downloads\wa\wa\Files\pre\Test.js" "C:\Users\livingston\Downloads\wa\wa\Files\output\samp.js" /t /m Step 2: Enter the command vsdiffmerge.exe If you do not find the Visual Studio command prompt then choose Visual Studio tools Step 1: Open the Visual Studio command prompt. To compare any two files and merge it to one file, here are the following steps you can follow if you have Visual Studio (any version) installed. In the properties dialog, you can find the path in "Target:" Right-Click on the Visual Studio and select Properties Windows Explorer opens with the Visual Studio shortcut highlighted. Right-click to bring up the context menu. In the Windows start menu, locate the Visual Studio icon *) Footnote: Because vsPath (the path to DEVENV.exe) differs depending on your version of Visual Studio, I am describing how you can find it out (Windows 10): You can even combine it with the script to gain elevated rights, with only a little extra effort. HINT: If you like the SendTo folder approach, there is more you can do - for example you can open a command shell directly via SendTo and it starts with the right path (the path where the selected file resides). Then, put the prepared shortcut into this folder.Īssuming the shortcut for the batch file VS_FileCompare.cmd is named "Compare2Files VS", you can select the two files, right-click and select Send To → Compare2Files VS to invoke the compare as shown below: Open the SendTo folder by entering shell:sendto into the file explorer's address bar (as described here).Create a shortcut "Compare2Files VS" for the batch file VS_FileCompare.cmd and copy it into the SendTo folder.It allows to use the context menu's Send To folder to compare the files. Here's an alternative how you can use the batch file VS_FileCompare.cmd mentioned in the section above. So you can compare multiple file pairs, but please ensure you have selected only two files at a time. In this case it will just open up a new window within the running instance of Visual Studio. Note: It does not harm if Visual Studio is already open. Select two files to compare in the explorerĭrag and drop them as shown in the animation below:Īfter a few seconds (depending on the launch time of Visual Studio), the results will be shown in Visual Studio: Save this code as VS_FileCompare.cmd to use it, and modify vspath if required to match the location of devenv.exe (depending on the Visual Studio version you're currently using, see footnote *) )Įither create a shortcut named "File Compare" for VS_FileCompare.cmd and place it on the desktop (as used in the animation below), so it is always available to drag
0 Comments
Leave a Reply. |