TIMEOUT is not an internal command of cmd.exe
(Windows Command Processor) like FOR or DIR.
It is an external command which means a console application being located in the Windows system directory %SystemRoot%\System32
.
On using just timeout
without file extension and without full path, the Windows command interpreter searches first in the current directory with timeout.*
for a file having a file extension listed in the local environment variable PATHEXT.
If no such file can be found in current directory, the Windows command interpreter continues the search for timeout.*
with a file extension listed in PATHEXT in the directories defined in the local environment variable PATH.
The system PATH is defined as follows on Windows Vista and later versions of Windows:
%SystemRoot%\system32;%SystemRoot%\system32;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
For that reason it is usually found first %SystemRoot%\System32\timeout.exe
on using just timeout
in a batch file.
But if the current directory contains a file with name timeout.*
having a file extension listed also in environment variable PATHEXT, or PATH was redefined locally or system wide by an installer which put other directory paths at the beginning instead of appending them at the end, and one of these directories contains also a timeout.*
file, the Windows command interpreter runs this executable or script.
The suggestions for solving this problem:
Use in the batch file %SystemRoot%\System32\timeout.exe
because then the Windows command processor must not search for this executable and it can't happen that the wrong timeout
is executed mistakenly, except the environment variable SystemRoot
is modified locally which is very unlikely in comparison to PATH
manipulations.
Open Windows Control Panel - System and Security (on View by: Category selected) - System - Advanced system settings (blue link on left side), select tab Advanced and click on button Environment Variables... There can be also clicked on Windows Start button and entered on keyboard environment and Windows suggests in the menu Edit environment variables for your account and Edit the system environment variables in the language of Windows. Click the latter suggested item and if necessary depending on Windows version next on button Environment Variables... Then search in lower half in list of System variables for Path, select this environment variable, click on Edit, and move all directory paths left or above (depends on Windows version) of %SystemRoot%\system32
to the end of the directories list.
Please report to the author of the application or software bundle which modified system PATH and inserted their directory paths at beginning instead of appending them at end about this wrong modification of Windows system PATH.
As Magoo wrote already: a timeout.*
ported from Unix to Windows is obviously executed on your Windows machine because of the output help statement. To get help on a command on Windows, the command has to be executed usually with parameter /?
and not with -h
or --help
as on Unix.