BMP Posted July 9, 2010 Share Posted July 9, 2010 I have write a litte Programm: $ProgrammPath=RegRead( "HKEY_CURRENT_USER\Software\EasySetup\{2E1C262F-B7FC-4046-B1F8-F49648BFC10E}", "InstallDir") DirCreate($ProgrammPath&"\Daten\SpielstandALT\") FileCopy($ProgrammPath&"\Daten\Spielstand\*.*", $ProgrammPath&"\Daten\SpielstandALT\*.*", 9) Run($ProgrammPath&"\esIUpdater.exe") The Copy works very well. But the Run doesent start the esIUpdater.exe. Scite shows no error, the Programm will not run in the Background. I have no Idea why ?? Greetz Marcus Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 (edited) Does this program require the Workdir to be set to the ProgramDir? Edited July 9, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 Does this program require the Workdir to be set to the ProgramDir?The work and ProgrammDir are the same... Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 (edited) Not in your script you shown..... The Workdir will be the directory where the script is located. Edited July 9, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 (edited) I have save it in C:\Programms\KoFuMa\ The RegKey shows on C:\Programms\KoFuMa\ If i say: Run(".\esIUpdater.exe") it is the same, no error but the EXE will not start. If i Start it whit hand it will ask for Admin rights, can this be a hind ? Edited July 9, 2010 by BMP Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 (edited) Try: Run($ProgrammPath&"\esIUpdater.exe",$ProgrammPath) Edited July 9, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 (edited) Its the same. The EXE will not Start..... I have try it whis this: run("C:\Program Files\KoFuMa\esIUpdater.exe", $ProgrammPath) But it will not work ;-( Edited July 9, 2010 by BMP Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 So the content of $ProgrammPath is "C:\Programms\KoFuMa\" ? If so try: Run($ProgrammPath&"esIUpdater.exe",$ProgrammPath) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 The same...... Not work.... Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 The same...... Not work.... so the answer to the question is? anyway what is the result of this script when run in SciTE? $ProgrammPath=RegRead( "HKEY_CURRENT_USER\Software\EasySetup\{2E1C262F-B7FC-4046-B1F8-F49648BFC10E}", "InstallDir") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ProgrammPath = ' & $ProgrammPath & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $rc=DirCreate($ProgrammPath&"\Daten\SpielstandALT\") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $rc=FileCopy($ProgrammPath&"\Daten\Spielstand\*.*", $ProgrammPath&"\Daten\SpielstandALT\*.*", 9) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $pid=Run($ProgrammPath&"\esIUpdater.exe") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $pid = ' & $pid & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : FileExists($ProgrammPath&"\esIUpdater.exe") = ' & FileExists($ProgrammPath&"\esIUpdater.exe") & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\KoFuMa\test.au3" @@ Debug(2) : $ProgrammPath = C:\Programme\KoFuMa\ >Error code: 0 @@ Debug(4) : $rc = 1 >Error code: 0 @@ Debug(6) : $rc = 1 >Error code: 0 @@ Debug(8) : $pid = 0 >Error code: 1 @@ Debug(9) : FileExists($ProgrammPath&"\esIUpdater.exe") = 1 >Error code: 0 >Exit code: 0 Time: 0.437 Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 (edited) and this: $ProgrammPath=RegRead( "HKEY_CURRENT_USER\Software\EasySetup\{2E1C262F-B7FC-4046-B1F8-F49648BFC10E}", "InstallDir") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $ProgrammPath = ' & $ProgrammPath & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $rc=DirCreate($ProgrammPath&"\Daten\SpielstandALT\") ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console $rc=FileCopy($ProgrammPath&"\Daten\Spielstand\*.*", $ProgrammPath&"\Daten\SpielstandALT\*.*", 9) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Sleep(500) $pid=ShellExecute($ProgrammPath&"esIUpdater.exe",$ProgrammPath) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $pid = ' & $pid & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : FileExists($ProgrammPath&"esIUpdater.exe") = ' & FileExists($ProgrammPath&"esIUpdater.exe") & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Edited July 9, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\KoFuMa\test.au3" @@ Debug(2) : $ProgrammPath = C:\Programme\KoFuMa\ >Error code: 0 @@ Debug(4) : $rc = 1 >Error code: 0 @@ Debug(6) : $rc = 1 >Error code: 0 C:\Program Files\KoFuMa\test.au3 (8) : ==> Incorrect number of parameters in function call.: $pid=Execute($ProgrammPath&"esIUpdater.exe",$ProgrammPath) $pid=^ ERROR >Exit code: 1 Time: 0.949 Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 (edited) You were tooo fast and missed the correction I made. Edited July 9, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\KoFuMa\test.au3" @@ Debug(2) : $ProgrammPath = C:\Programme\KoFuMa\ >Error code: 0 @@ Debug(4) : $rc = 1 >Error code: 0 @@ Debug(6) : $rc = 1 >Error code: 0 @@ Debug(9) : $pid = 1 >Error code: 0 @@ Debug(10) : FileExists($ProgrammPath&"esIUpdater.exe") = 1 >Error code: 0 >Exit code: 0 Time: 3.816 the Programm will start after the end of the Script..... Now you can tell me where are my error ? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 9, 2010 Developers Share Posted July 9, 2010 If you want the script to wait for the program to finish you need to use ShellExecuteWait(). SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BMP Posted July 9, 2010 Author Share Posted July 9, 2010 Thank you.... I now work with "ShellExecuteWait" and all look good. But i think it must be the same whith RUN ?? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 10, 2010 Developers Share Posted July 10, 2010 (edited) But i think it must be the same whith RUN ?? Assume it is an console program which you run from the CMD prompt or open the CMD prompt whem ran from FileExplorer? Agree Run() should work too but have seen this happening. Probably this works too: Run(@ComSpec & ' /c "' & $ProgrammPath & 'esIUpdater.exe"',$ProgrammPath) Jos Edited July 10, 2010 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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