I created in notepad a bat file containing this line:
Code: Select all
msinfo32.exe /nfo C:\TEMP\test.nfo
After some minutes i saw the file test.nfo in te C:\TEMP
This is working good.
Now i wanted to do what i did in my older bat file to make that the nfo file will be created in a specific directory.
So i tried to do what i did in my old bat.
Code: Select all
set today=%date:~7,2%-%date:~4,2%-%date:~-2%
msinfo32.exe /nfo %USERPROFILE%\AppData\Local\Diagnostic_Tool_Blue_Screen\Diagnostic Tool Blue Screen\SF_%today%\msinfo32.nfo
The variable today contain the name of the directory to create the file inside.
When im running the bat file i see in the cmd window this:
D:\C-Sharp\Diagnostic Tool Blue Screen\Diagnostic Tool Blue Screen\Diagnostic To
ol Blue Screen\bin\Debug>set today=25-07-13
D:\C-Sharp\Diagnostic Tool Blue Screen\Diagnostic Tool Blue Screen\Diagnostic To
ol Blue Screen\bin\Debug>msinfo32.exe /nfo C:\Users\bout0_000\AppData\Local\Diag
nostic_Tool_Blue_Screen\Diagnostic Tool Blue Screen\SF_25-07-13\msinfo32.nfo
All directories are correct. But when the bat file end and closed i can't see the nfo file in the SF_25-07-13 directory. It didnt create it.
What could be the problem ?
****
This is my old bat file content which is working:
Code: Select all
set today=%date:~7,2%-%date:~4,2%-%date:~-2%
%systemroot%\system32\dxdiag.exe /t %USERPROFILE%\AppData\Local\Diagnostic_Tool_Blue_Screen\Diagnostic Tool Blue Screen\SF_%today%\dxdiag.txt
Why the dxdiag code is working fine and the code with the msinfo32 is not working when using the %today% variable ?