petkarg
September 24th, 2003, 05:19 PM
I have a batch file which is used to run some program and dump the output from that program to a text file. The name of the text file is generated from date/time information which is gathered from the environment. On some systems the name is not created properly. It fails to get the date.
After performing some experiments I was able to make it work by removing the parameter which is passed to the cmd.
ComSpec = c:\WinNT\System32\cmd /e:8192 - does not work
ComSpec = c:\WinNT\System32\cmd /e: - works
I assumed that after removing 8192 there is no limit for environment resources so it worked.
Is this correct?
Why don't I face the problem on all machines?
Following is a part of batch file which is used to create the file name
FOR /F "TOKENS=2-4 DELIMS=/ " %%A IN ('DATE/T') DO SET DATE=%%C-%%A-%%B
FOR /F "TOKENS=1-2 DELIMS=: " %%A IN ('TIME/T') DO SET TIME=%%A-%%B
SET cl_filename=ProcessState-%DATE%-%TIME%.txt
Thanks
Ganesh
After performing some experiments I was able to make it work by removing the parameter which is passed to the cmd.
ComSpec = c:\WinNT\System32\cmd /e:8192 - does not work
ComSpec = c:\WinNT\System32\cmd /e: - works
I assumed that after removing 8192 there is no limit for environment resources so it worked.
Is this correct?
Why don't I face the problem on all machines?
Following is a part of batch file which is used to create the file name
FOR /F "TOKENS=2-4 DELIMS=/ " %%A IN ('DATE/T') DO SET DATE=%%C-%%A-%%B
FOR /F "TOKENS=1-2 DELIMS=: " %%A IN ('TIME/T') DO SET TIME=%%A-%%B
SET cl_filename=ProcessState-%DATE%-%TIME%.txt
Thanks
Ganesh