The Little Guy Posted January 15, 2012 Share Posted January 15, 2012 What is the best way to run a php file in the background from a Scheduled Task? I should say that when I use the Task Scheduler, the CMD always pops up to run the task, is there any way to hide it? Link to comment https://forums.phpfreaks.com/topic/255037-windows-tasks-run-in-background/ Share on other sites More sharing options...
trq Posted January 15, 2012 Share Posted January 15, 2012 I should say that when I use the Task Scheduler, the CMD always pops up to run the task, is there any way to hide it? It shouldn't. How exactly have you set it up? Link to comment https://forums.phpfreaks.com/topic/255037-windows-tasks-run-in-background/#findComment-1307732 Share on other sites More sharing options...
The Little Guy Posted January 15, 2012 Author Share Posted January 15, 2012 I don't know if this helps: <?xml version="1.0" encoding="UTF-16"?> <Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2012-01-14T20:08:26.8133442</Date> <Author>Ryan-PC\Ryan</Author> </RegistrationInfo> <Triggers> <CalendarTrigger> <Repetition> <Interval>PT30M</Interval> <StopAtDurationEnd>false</StopAtDurationEnd> </Repetition> <StartBoundary>2012-01-14T00:00:00</StartBoundary> <Enabled>true</Enabled> <ScheduleByDay> <DaysInterval>1</DaysInterval> </ScheduleByDay> </CalendarTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId>Ryan-PC\Ryan</UserId> <LogonType>InteractiveToken</LogonType> <RunLevel>LeastPrivilege</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>true</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession> <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>P3D</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>C:\wamp\bin\php\php5.3.8\php.exe</Command> <Arguments>C:\cron\game.weblyize.com\game_year.php</Arguments> <WorkingDirectory>C:\cron</WorkingDirectory> </Exec> </Actions> </Task> Link to comment https://forums.phpfreaks.com/topic/255037-windows-tasks-run-in-background/#findComment-1307735 Share on other sites More sharing options...
The Little Guy Posted January 15, 2012 Author Share Posted January 15, 2012 I have no idea what I did, but it works now. Link to comment https://forums.phpfreaks.com/topic/255037-windows-tasks-run-in-background/#findComment-1307879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.