Jump to content

Run on Windows7


Recommended Posts

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

  • Developers

Does this program require the Workdir to be set to the ProgramDir?

Edited 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

  • Developers

Not in your script you shown.....

The Workdir will be the directory where the script is located.

Edited 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

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 by BMP
Link to comment
Share on other sites

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 by BMP
Link to comment
Share on other sites

  • Developers

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

  • Developers

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

>"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

  • Developers

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 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

>"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

>"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

  • Developers

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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...