Shadowing Posted December 20, 2011 Share Posted December 20, 2011 Can someone help me out with making a bat file. I cant find a good set of directions on google. I have window scheduler all working in running but it runs my script in note pad and not IE like I need it too. I also read something about php cgi file for doing this same thing but cant make heads of tails out of it from reading about it in the manual. Trying to run this http://localhost/gate/users/update.php Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/ Share on other sites More sharing options...
scootstah Posted December 20, 2011 Share Posted December 20, 2011 Do you actually need it to load in a browser? If you just want to run the script you can use the PHP command line tools... C:\PHP5\php.exe -f "Path/to/script/here" Make sure you set the interpreter location to where ever your PHP is installed to. Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299785 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 Hey scootstah Yah i dont really need it to run in the browser ok I opened php.exe and typed in C:\software\XAMPP\xampp\php -f "C:\Software\XAMPP\xampp\htdocs\stargate\users\update.php" then I hit enter and it just took me to the next line Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299790 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 i dont understand why all the instructions online stop at this point am i suppose to use window scheduler to open up php.exe while i have this command line wrote in it? Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299797 Share on other sites More sharing options...
scootstah Posted December 20, 2011 Share Posted December 20, 2011 You don't open up php.exe, you open command prompt and then type in the php.exe. Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299800 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 ahh alright i typed this into command prompt and got c:\software\xampp\xampp\php is not a recognized as an internal or external command. operable program or batch file. C:\software\XAMPP\xampp\php -f "C:\Software\XAMPP\xampp\htdocs\stargate\users\update.php" Thats my exact dir where my php folder is located though Im using xampp with PHP 5.3.8 Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299802 Share on other sites More sharing options...
scootstah Posted December 20, 2011 Share Posted December 20, 2011 You need to actually have the .exe part. Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299804 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 when command prompt first loads I get D:\documents and settings\shadowings> so I hit c: enter brings me down to c:\> then I type software\XAMPP\xampp\php.exe -f "C:\Software\XAMPP\xampp\htdocs\stargate\users\update.php" and gives the same error Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299810 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 opps forgot to go php/php.exe ok that loaded my script. whats my next step. how do i make this load my script every hour Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299817 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 ahh figured out how to make a bat file, then use what you told me to put in the bat file and then have window scheduler run it every minute pretty awesome Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299847 Share on other sites More sharing options...
scootstah Posted December 20, 2011 Share Posted December 20, 2011 Just curious, what are you doing that needs to be updated every 1 minute? Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299859 Share on other sites More sharing options...
Shadowing Posted December 20, 2011 Author Share Posted December 20, 2011 making a web broswer game. every one minute was just to test it. making it so every hour it updates all accounts adding resources for players really appreciate you helping me out these last few weeks scootstah. im learning alot. i just have a hard time understanding the manuals on things Quote Link to comment https://forums.phpfreaks.com/topic/253555-making-a-bat-file-for-window-task-scheduler/#findComment-1299863 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.