Julien.alkaza Posted February 2, 2006 Share Posted February 2, 2006 Hello, I'm trying to find a solution but I can't!!! What I want to do is to run a program with parameters : "C:\Program Files\2BrightSparks\SyncBack\SyncBack.exe" -m "save" But, it doesn't work!!! It seems to be a quotes problem, but I can't find where!!! I'serach for 2 hours on the forum but didn't find anything!!! Thanks for help!! Oh, my line of code : RunWait('"C:\Program Files\2BrightSparks\SyncBack\SyncBack.exe" -m "save"', "C:\Program Files\2BrightSparks\SyncBack") What???????? Link to comment Share on other sites More sharing options...
Jotun Posted February 2, 2006 Share Posted February 2, 2006 (edited) Maybe this will work: RunWait('"' & "C:\Program Files\2BrightSparks\SyncBack\SyncBack.exe" & '"' & " -m " & '"' & "save" & '"', "C:\Program Files\2BrightSparks\SyncBack") Edited February 2, 2006 by Jotun Link to comment Share on other sites More sharing options...
MHz Posted February 2, 2006 Share Posted February 2, 2006 Good idea to use Macro's where suitable. You could try to not using a working directory parameter as well to see if that works, as I see little wrong with your syntax. RunWait('"' & @ProgramFilesDir & '\2BrightSparks\SyncBack\SyncBack.exe" -m "save"', @ProgramFilesDir & '\2BrightSparks\SyncBack') Link to comment Share on other sites More sharing options...
Julien.alkaza Posted February 2, 2006 Author Share Posted February 2, 2006 Thanks!! But it still doesn't work!! In fact the application runs but it does not do what I want. The aim is to synchronise files between My documents and a file server. Configuration is made in a profile called save. This command works well in a dos shell, but not in autoit. I've tried your two solutions What???????? Link to comment Share on other sites More sharing options...
Xenobiologist Posted February 2, 2006 Share Posted February 2, 2006 (edited) Hi, what about RunWait(0, '"' & "C:\Program Files\2BrightSparks\SyncBack\SyncBack.exe" _ & '"' & " -m " & '"' & "save" & '"', '"' & "C:\Program Files\2BrightSparks\SyncBack" & '"' ) I don´t know whether the save command has to be surrounded by quotes. But if you post your dos-command, we´ll find the solution. So long, Mega Edited February 2, 2006 by th.meger Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
MHz Posted February 2, 2006 Share Posted February 2, 2006 I have tested the line in my last post and works fine (folder to another folder). I also tried the below and that works. $dir_start = @WorkingDir $dir_program = @ProgramFilesDir & '\2BrightSparks\SyncBack' FileChangeDir($dir_program) RunWait('SyncBack.exe -m "save"') FileChangeDir($dir_start) I am not sure of your problem, unless it is something to do with your file server and permissions or something else. -m is the default action so can be left out of the command if desired. Link to comment Share on other sites More sharing options...
Bert Posted February 2, 2006 Share Posted February 2, 2006 I know this may sound messy, but if it will work in a DOS shell, make a batch file with the comand, and do a run statement to run the batch file. I hate resorting to a solution like that, but sometimes if you don't know a better way, do what works. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
flyingboz Posted February 3, 2006 Share Posted February 3, 2006 (edited) You may wish to StringFormat() the desired command line - creates nice readable code w/o all the ampersands. $dir = "c:\program files\2BrightSparks\SyncBack" $exe = "SyncBack.exe" $cmd = StringFormat('"%s\\%s" -m save',$dir,$exe) RunWait($cmd,$dir) See the StringFormat doc if the \\ is unclear...It might be better to do it this way (untested): $dir = "c:\program files\2BrightSparks\SyncBack" $exe = '\' & "SyncBack.exe" $cmd = StringFormat('"%s%s" -m save',$dir,$exe) RunWait($cmd,$dir) Edited February 3, 2006 by flyingboz Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
blademonkey Posted February 3, 2006 Share Posted February 3, 2006 (edited) If you have lots of switches in a runwait (without the comspec) i have noticed that it will usually fail. try this RunWait(@comspec & ' /c "C:\Program Files\2BrightSparks\SyncBack\SyncBack.exe" -m "save"') Edited February 3, 2006 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
sjorrel Posted February 3, 2006 Share Posted February 3, 2006 I usually use _rundos() for things like this. Also, when formatting complex dos commands, I use clipput() as a debugging tool, so that whatever you are attempting to run in autoit is pasted to the clipboard. Try pasting it into a dos window, executing it and see what errors are being thrown up. Link to comment Share on other sites More sharing options...
flaxcrack Posted February 3, 2006 Share Posted February 3, 2006 If you have lots of switches in a runwait (without the comspec) i have noticed that it will usually fail. try this RunWait(@comspec & ' /c "C:\Program Files\2BrightSparks\SyncBack\SyncBack.exe" -m "save"') I'm going to agree with BladeMonkey on this one. His code should work flawlessly. [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
blademonkey Posted February 3, 2006 Share Posted February 3, 2006 I usually use _rundos() for things like this.Also, when formatting complex dos commands, I use clipput() as a debugging tool, so that whatever you are attempting to run in autoit is pasted to the clipboard. Try pasting it into a dos window, executing it and see what errors are being thrown up.Good point.I personnally use the consolewrite() command for debugging. It goes write into the Scite debug window and is a life saver for Loop issues. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
Confuzzled Posted February 9, 2006 Share Posted February 9, 2006 From the help file:StringsStrings are enclosed in double-quotes like "this". If you want a string actually contain a double-quote use it twice like: "here is a ""double-quote"" - ok?"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. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them: 'This "sentence" contains "lots" of "double-quotes" does it not?'is much simpler than: "This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"When evaluated, strings can have Env variables or Var variables substitution according to Opt() function definition.So: Put the whole lot inside a set of single quotes and see if that does the trick. 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