I am using Windows XP Service Pack 3 (SP3) and the command extensions are included in the Windows Registry by default. One way or another, the following command does not work on this version of Windows, but if I run it on Windows Server 2003 or Windows Vista Business, it works fine. Any clue?
The problem is that in Windows XP it seems that the / f option does not work at all, and part of the command is never executed.
This is the command:
for /f "tokens=1 delims=: " %A in ('tasklist /FI "IMAGENAME eq python.exe" /NH') do ( If "%A" == "python.exe" ( echo "It running" ) Else ( echo "It not running" ) )
Thanks in advance.
source share