Jump to content
Sign in to follow this  
Slythfox

Running exe from another directory?

Recommended Posts

Slythfox

Okay, so I have this:

RunWait(@ScriptDir & "/bin/php/php.exe script.php")

It displays a window real quickly (not enough time to read it).

If I put php.exe, script.php, etc in the same directory as the autoit script, the script works (exact code above). I've tried creating a script in a bat to run the command which doesn't work in autoit. I've also tried _RunDos() and ShellExecute(), both of which have the same issue.

I don't want to have php.exe and everything in the main directory, as it is disorganized for the programmer, and confusing for the user. How is this fixable?

Share this post


Link to post
Share on other sites
PsaltyDS

Add your working dir parameter, per the help file on RunWait():

RunWait(@ScriptDir & "/bin/php/php.exe script.php", "/bin/php")

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
PsaltyDS

instead of "/" use "\" :)

Windows is actually pretty tolerant of forward slashes mixed in to paths. Try some CD commands from a DOS shell. It works.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Lemmens Peter

Hi,

Maybe if php.exe and script.php are not in the same directory, you need to add the full path of both.

(eg if script.php is in a new created dir called "PHPScriptsDir")

RunWait(@ScriptDir & "\bin\php\php.exe " & @ScriptDir & "\PHPScriptsDir\script.php")

Good luck,

Peter

Share this post


Link to post
Share on other sites
Slythfox

Hi,

Maybe if php.exe and script.php are not in the same directory, you need to add the full path of both.

(eg if script.php is in a new created dir called "PHPScriptsDir")

RunWait(@ScriptDir & "\bin\php\php.exe " & @ScriptDir & "\PHPScriptsDir\script.php")

Good luck,

Peter

I've done that too. Doesn't work.

I got this to work:

RunWait(@ScriptDir & "/bin/php/php.exe base64_encode.php", @ScriptDir & "/bin/php/")

Thanks a bunch! I was always confused what that second attribute did.

EDIT: Wait, How do I get the window to hide. It almost seems as if the php script doesn't run when I add " ,@SW_HIDE"

EDIT2: NVM, I think it's just GUI lag. (The PHP script outputs a lot!)

Edited by Slythfox

Share this post


Link to post
Share on other sites
Zedna

original

RunWait(@ScriptDir & "/bin/php/php.exe base64_encode.php", @ScriptDir & "/bin/php/")oÝ÷ Ú'Òr¸©´8«ríj)ì²z̨ºk¬µÉh±è­¶®¢×¬Â§¥«,x)j¶¦zÚÞ±«­¢+ÙIÕ¹]¥Ð ÌäìÅÕ½ÐìÌäìµÀìMÉ¥ÁѥȵÀìÌäì½¥¸½Á¡À½Á¡À¹áÅÕ½ÐìÍØÑ}¹½¹Á¡ÀÌäì°MÉ¥ÁѥȵÀìÅÕ½Ðì½¥¸½Á¡À¼ÅÕ½Ðì¤

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  

×