Jump to content
Sign in to follow this  
BMP

Run on Windows7

Recommended Posts

BMP

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

Share this post


Link to post
Share on other sites
BMP

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

The work and ProgrammDir are the same...

Share this post


Link to post
Share on other sites
BMP

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

Share this post


Link to post
Share on other sites
BMP

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

Share this post


Link to post
Share on other sites
BMP

The same...... Not work....

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
BMP

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

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
BMP

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

Share this post


Link to post
Share on other sites
BMP

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

Share this post


Link to post
Share on other sites
BMP

Thank you....

I now work with "ShellExecuteWait" and all look good.

But i think it must be the same whith RUN ??

Share this post


Link to post
Share on other sites
Jos

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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  

×