CarlFerrer Posted May 23, 2015 Share Posted May 23, 2015 Good day,I am trying to use AutoIt to automate file comparison and am using the code below. BCCompare.exe is for Beyond Compare application. This stops right at the M (in red), with a syntax error. What can be the issue? #include <Process.au3>Local $iRc = _RunDos("BCompare.exe @"My Script.txt" "My File.txt" "Your File.txt" "My Report.txt"") Link to comment Share on other sites More sharing options...
SadBunny Posted May 23, 2015 Share Posted May 23, 2015 The second " in that line terminates the string, which makes AutoIt expect AutoIt code. Solution: "escape" the doublequotes by doubling them:$line = "this is a ""quoted"" word" Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
CarlFerrer Posted May 24, 2015 Author Share Posted May 24, 2015 Thanks, SadBunny!Modified as suggested. No syntax error at this time, but still don't see my result.Local $iRc = _RunDos("Bcompare.exe @""C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_script.txt"" ""C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_1.txt"" ""C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_2.txt"" ""C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_report.txt""")When I tried this below in DOS, it works: Bcompare.exe @"C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_script.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_1.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_2.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_report.txt" Link to comment Share on other sites More sharing options...
SadBunny Posted May 24, 2015 Share Posted May 24, 2015 As the helpfile for _RunDos states, the return value is the exit code of the command. If you want to read the standard output (stdout) of a command, check the helpfile for StdoutRead(). Pay attention to the example, it is somewhat less straightforward than some other commands. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
qwert Posted May 24, 2015 Share Posted May 24, 2015 (edited) Isn't this a good case for using single quotes to clarify strings being passed?From the help file:You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want.Actually, the help file isn't quite correct. It should show this as the example of use:You can also use single-quotes like 'this' and 'here is a "single-quote" - ok?' Edited May 24, 2015 by qwert correct for error in help file's example Link to comment Share on other sites More sharing options...
BrewManNH Posted May 24, 2015 Share Posted May 24, 2015 I would do it this way.Local $iRc = Run('"FULLPATHTOTHEEXEFILE\Bcompare.exe "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_script.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_1.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_2.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_report.txt"') If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
BrewManNH Posted May 24, 2015 Share Posted May 24, 2015 I would do it this way.Local $iRc = Run('"FULLPATHTOTHEEXEFILE\Bcompare.exe "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_script.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_1.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\subser1_2.txt" "C:\Users\Carlos\Desktop\MCAP_test_auto\autoit\cf_report.txt"') If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
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