How to create systeminfo file through batch file ?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
chocolade
Posts: 10
Joined: 23 Jul 2013 23:38

How to create systeminfo file through batch file ?

#1 Post by chocolade » 25 Jul 2013 10:05

I tried this:

Code: Select all

@echo=off
set today=%date:~7,2%-%date:~4,2%-%date:~-2%
start "" /wait systeminfo > "%USERPROFILE%\AppData\Local\Diagnostic_Tool_Blue_Screen\Diagnostic Tool Blue Screen\SF_%today%\systeminfo.txt"
pause


But in the directory in the end i see the file systeminfo.txt but its 0kb empty.
If im doing:

Code: Select all

systeminfo > C:\TEMP\systemoinfo.txt


Then i see the file 8kb in c:\temp no problems.

What am i doing wrong ?

Tried without /wait
Tried without the "" " "
Tried without the >

Nothing wroked.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: How to create systeminfo file through batch file ?

#2 Post by Squashman » 25 Jul 2013 11:12

Why do you need to use the START command?
What is wrong with just using.

Code: Select all

systeminfo > "%USERPROFILE%\AppData\Local\Diagnostic_Tool_Blue_Screen\Diagnostic Tool Blue Screen\SF_%today%\systeminfo.txt"

chocolade
Posts: 10
Joined: 23 Jul 2013 23:38

Re: How to create systeminfo file through batch file ?

#3 Post by chocolade » 25 Jul 2013 11:54

Thanks its working.

Dos_Probie
Posts: 233
Joined: 21 Nov 2010 08:07
Location: At My Computer

Re: How to create systeminfo file through batch file ?

#4 Post by Dos_Probie » 27 Jul 2013 20:08

Here is another way..System info and also a list of all updates which can come in handy..DP 8)

Code: Select all

@echo off&color e

:: ### System Information..
 for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set today=%date:~4,2%-%date:~7,2%-%date:~-2%)
 set sysinfo_Dt=%today%
 msinfo32.exe /nfo "%userprofile%\desktop\SysInfo_%sysinfo_Dt%_.nfo"

:: ### Windows Updates..
 set wusa_Dt=%today%
 systeminfo | find ": KB">nul>>"%userprofile%\desktop\wusa_%wusa_Dt%_.log"

Post Reply