I've written a simple batch script that redirects the output of the command to a file, however, I'm still seeing the date output in the terminal screen. Each Function Starts with a colon, double colons are comments. At the end of the script I call each Function and lastly I'm utilizing the builtin pause command. Anyone know why I'm seeing just one single date output?
@echo off
::navigate to correct folder
cd C:\TimsFolder2
::verify directories are created
if exist C:\TimsFolder2\compInfo (ECHO TimsFolder2 is present)^
Else (mkdir compInfo && echo "TimsFolder2^\compInfo directory created")
if exist C:\TimsFolder2\groupInfo (ECHO TimsFolder2 is present)^
Else (mkdir groupInfo && echo TimsFolder2^\groupInfo created)
if exist C:\TimsFolder2\networkInfo (ECHO TimsFolder2 is present)^
Else (mkdir networkInfo && echo TimsFolder2^\networkInfo created)
if exist C:\TimsFolder2\userInfo (ECHO TimsFolder2 is present)^
Else (mkdir userInfo && echo TimsFolder2^\userInfo)
::system Info Function
:sysInfo
date /t && time /T > C:\TimsFolder2\compInfo\compInfo.txt
ver >> C:\TimsFolder2\compInfo\compInfo.txt
fsutil fsinfo drives >> C:\TimsFolder2\compInfo\compInfo.txt
wmic OS get /format:list >> C:\TimsFolder2\compInfo\compInfo.txt
wmic BIOS get /format:list >> C:\TimsFolder2\compInfo\compInfo.txt
wmic BOOTCONFIG get /format:list >> C:\TimsFolder2\compInfo\compInfo.txt
wmic CPU get /format:list >> C:\TimsFolder2\compInfo\compInfo.txt
wmic memphysical get /format:list >> C:\TimsFolder2\compInfo\compInfo.txt
EXIT /B 0
::User Info Function
:userInfo
date /t && time /T > C:\TimsFolder2\userInfo\userInfo.txt
hostname >> C:\TimsFolder2\userInfo\userInfo\userInfo.txt
whoami >> C:\TimsFolder2\userInfo\userInfo.txt
EXIT /B 0
::Group Info Function
:groupInfo
date /t && time /T > C:\TimsFolder2\groupInfo\groupInfo.txt
net users >> C:\TimsFolder2\groupInfo\groupInfo.txt
net accounts >> C:\TimsFolder2\groupInfo\groupInfo.txt
gpresult /R >> C:\TimsFolder2\groupInfo\groupInfo.txt
EXIT /B 0
::NetworkInfo Info Function
:networkInfo
date /t && time /T > C:\TimsFolder2\networkInfo\networkInfo.txt
route print >> C:\TimsFolder2\networkInfo\networkInfo.txt
netsh interface ipv4 show addresses >>
C:\TimsFolder2\networkInfo\networkInfo.txt
getmac >> C:\TimsFolder2\networkInfo\networkInfo.txt
arp -a >> C:\TimsFolder2\networkInfo\networkInfo.txt
EXIT /B 0
::File System
:fileSystem
cd C:\TimsFolder2
forfiles
EXIT /B 0
call : sysInfo
call : userInfo
call : groupInfo
call : networkInfo
call : fileSystem
pause