amakrkr Posted January 10, 2011 Share 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! Link to comment Share on other sites More sharing options...
Darknight1366 Posted January 10, 2011 Share 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 Link to comment Share on other sites More sharing options...
amakrkr Posted January 10, 2011 Author Share 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 >.< Link to comment Share on other sites More sharing options...
amakrkr Posted January 10, 2011 Author Share Posted January 10, 2011 PS shellexecute doesnt work as well... Link to comment Share on other sites More sharing options...
KingNED Posted January 10, 2011 Share 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 " Link to comment Share on other sites More sharing options...
amakrkr Posted January 10, 2011 Author Share 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. >.< Link to comment Share on other sites More sharing options...
ZacUSNYR Posted January 10, 2011 Share 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) Link to comment Share on other sites More sharing options...
JohnOne Posted January 10, 2011 Share 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. Link to comment Share on other sites More sharing options...
KaFu Posted January 10, 2011 Share Posted January 10, 2011 Take a look at my example for a working implementation . OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) 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 (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Darknight1366 Posted January 10, 2011 Share 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 Link to comment Share on other sites More sharing options...
amakrkr Posted January 11, 2011 Author Share 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now