I have a batch file, that calls a WMIC command. The WMIC command is inside a for loop.
Calling this batch file results in indefinite hang, and it seems to hang for more than 2 to 3 hours, only way to get out is by terminating the process by pressing CTRL+C.
The WMIC command is:
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year
/Format:table')
The script hangs only when it is executed on windows server 2003, it works perfectly fine on other operating system.
The server that has server 2003 also has AMD processor, is this the cause? or is there something else that I am missing?
By the way the script is called in the line:
%LOGMESSAGE% do something .
And LOGMESSAGE variable is set to call the script containing the WMIC command as follow:
set LOGMESSAGE=call path_to_the_script\WMIC.cmd
Any suggestion is very much helpful, thanks a ton in advance.