amakrkr 1 Posted January 10, 2011 Hello all, what am i trying to do is ... run .php script with my Autoit program. So far i came up with this which obviousely dont work: Run("c:\php\php script.php") Anyone has any suggestions? I think the problem is that Run command executes php.exe and then stops. I have also tried with "php.exe " & "script.php" and still doesnt work... Thank you for your help! Share this post Link to post Share on other sites
Darknight1366 0 Posted January 10, 2011 You need to explain more detail that what the problem is and what the Script says. Maybe ShellExecute("c:\php\php script.php") Visit HugeSoft(TM) To Get Any Coding Help or Anything Share this post Link to post Share on other sites
amakrkr 1 Posted January 10, 2011 Hi, problem is: If i open command prompt and i try to execute my PHP script using this command C:\PHP\PHP SCRIPT.PHP it works. But when i copy this command to autoit like this Run("c:\php\php script.php") it doesnt work. Why? I do not know.... i dont get any errors or anything that i could post here. The only problem there could be is that Run command stops at php.exe and it doesnt take argument script.php. Sorry for my terrible English >.< Share this post Link to post Share on other sites
amakrkr 1 Posted January 10, 2011 PS shellexecute doesnt work as well... Share this post Link to post Share on other sites
KingNED 0 Posted January 10, 2011 like this Run("c:\php\php script.php") it doesnt work. Why? I do not know.... i dont get any errors or anything that i could post here. Try this: Run(@ComSpec & " /c " & 'c:\php\php script.php', "", @SW_HIDE) AutoIt wants the @ ComSpec & " /c " Share this post Link to post Share on other sites
amakrkr 1 Posted January 10, 2011 Try this: Run(@ComSpec & " /c " & 'c:\php\php script.php', "", @SW_HIDE) AutoIt wants the @ ComSpec & " /c " hmm still same resoult .... i had to remove @sw_hide so i could see if there would be any errors in CMD. Now cmd hangs on "c:\windows\system32\cmd.exe" and again doesnt do nothing with php sript. >.< Share this post Link to post Share on other sites
ZacUSNYR 4 Posted January 10, 2011 Try this: Run(@ComSpec & " /c " & 'c:\php\php script.php', "", @SW_HIDE) AutoIt wants the @ ComSpec & " /c " Run(@ComSpec & ' /c c:\php\php.exe script.php', "C:\php", @SW_HIDE) Or try that It sounds like when php.exe is kicking the working path doesn't know where the php file is. You could do Run(@ComSpec & ' /c c:\php\php.exe c:\php\script.php', "C:\php", @SW_HIDE) Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 10, 2011 or Run('"c:\php\php script.php"') AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
KaFu 295 Posted January 10, 2011 Take a look at my example for a working implementation . OS: Win10-1909 - 64bit - German, AutoIt Version: 3.3.14.5, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2019-Dec-21) BIC - Batch-Image-Cropper (2019-Dec-11) COP - Color Picker (2009-May-21) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2019-Dec-07) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Share this post Link to post Share on other sites
Darknight1366 0 Posted January 10, 2011 Only Run is the Start Menu Run. So you can run calc or notepad on Only Run. Visit HugeSoft(TM) To Get Any Coding Help or Anything Share this post Link to post Share on other sites
amakrkr 1 Posted January 11, 2011 Hello again, many thanks for replays, this was really frustrating for me Anyway this line posted by ZacUSNYR saved the day: Run(@ComSpec & ' /c c:\php\php.exe script.php', "C:\php", @SW_HIDE) Run(@ComSpec & ' /c c:\php\php.exe script.php', "C:\php", @SW_HIDE) Or try that It sounds like when php.exe is kicking the working path doesn't know where the php file is. You could do Run(@ComSpec & ' /c c:\php\php.exe c:\php\script.php', "C:\php", @SW_HIDE) Thanks again for all your replays! Share this post Link to post Share on other sites