Batchfile not working through php (timeout)

mathatbads

I have here a batch file that works when i double click it. However, running this batch file through php launches notepad and just kills it right away.

START C:\Windows\NOTEPAD.EXE
timeout /t 60 
taskkill /im "NOTEPAD.EXE" /f

Is there any reason why timeout doesn't work? Any help is appreciated. Thanks!

Edit: I have refactored the code but pause also gets skipped.

START C:\Windows\NOTEPAD.EXE

..\..\..\Windows\System32\timeout.exe /t 1000
pause
taskkill /im "NOTEPAD.EXE" /f
Brian Patterson

Try using a PING timeout to see if it fixes the problem with delay..

PING -n 60 127.0.0.1>nul

https://ss64.com/nt/timeout.html

Timeout will pause command execution for a number of seconds, after which it continues without requiring a user keystroke. If the user does press a key at any point, execution will resume immediately.

A delay can also be produced by the PING command with a loopback address, there is a delay of 1 second between each consecutive ping.

In tests PING consumes less processor time than Sleep.exe or Timeout.exe, this allows other processes to run in the background. The PING command can only be interrupted with Ctrl-C. Source: Clay Calvert (usenet 2001.)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Session timeout program in php not working

From Dev

MySQL not working through PHP

From Dev

CURLOPT_TIMEOUT not working at all (php)

From Dev

CURLOPT_TIMEOUT not working at all (php)

From Dev

UPDATE for MySQL through PHP not working

From Dev

Mysql variable not working through php

From Dev

UPDATE for MySQL through PHP not working

From Dev

Windows 7 batchfile to iterate through subdirectories selecting first file

From Dev

Windows 7 batchfile to iterate through subdirectories selecting first file

From Dev

Disable/enable lan-device by batchfile: If comparisons not working

From Dev

Sending an email through php, why is not working?

From Dev

Updating a mysql column to NULL through PHP is not working

From Dev

Argument pass through php into bash file not working

From Dev

Argument pass through php into bash file not working

From Dev

InProc session timeout not working

From Dev

Socket timeout not working

From Dev

Lua https timeout is not working

From Dev

timeout for ngShow not working as expected

From Dev

Timeout not working in AsyncTask class

From Dev

Socket timeout not working

From Dev

Timeout in connect() not working

From Dev

CXF Timeout not working

From Dev

timeout for ngShow not working as expected

From Dev

Volley setRetryPolicy timeout is not working

From Dev

Alamofire timeout not working

From Dev

removeClass in timeout not working

From Dev

Big files download through php function readfile not working

From Dev

mysql load data infile through php script - not working

From Dev

Pass multiple variables via Ajax through variable to PHP not working