Jump to content

Running exe from another directory?


Recommended Posts

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?

Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

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

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É¥ÁѥȵÀìÅÕ½Ðì½¥¸½Á¡À¼ÅÕ½Ðì¤
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...