Skip to content

Instantly share code, notes, and snippets.

@tshm
Last active May 26, 2022 12:26
Show Gist options
  • Select an option

  • Save tshm/9c07496e84d364665fc4 to your computer and use it in GitHub Desktop.

Select an option

Save tshm/9c07496e84d364665fc4 to your computer and use it in GitHub Desktop.
information collection batch script
pushd c:\log
systeminfo > systeminfo.txt
msinfo32 /report msinfo32.txt
ipconfig /all > ipconfig.txt
schtasks /query /V > schtasks.txt
net use > netuse.txt
netstat -sp > netstat_sp.txt
netstat -e > netstat_e.txt
tasklist > tasklist.txt
tasklist /svc > tasklist_svc.txt
tasklist /m > tasklist_m.txt
wevtutil qe system /f:TEXT > system_log.txt
wevtutil qe Application /f:TEXT > Application_log.txt
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$dd = $(get-date -format yyyyMMddhhmss)
mkdir ($scriptPath + '/' + $dd)
pushd ($scriptPath + '/' + $dd)
systeminfo > systeminfo.txt
msinfo32 /report msinfo32.txt
ipconfig /all > ipconfig.txt
schtasks /query /V > schtasks.txt
net use > netuse.txt
netstat -sp > netstat_sp.txt
netstat -e > netstat_e.txt
tasklist > tasklist.txt
tasklist /svc > tasklist_svc.txt
tasklist /m > tasklist_m.txt
wevtutil qe system /f:TEXT > system_log.txt
wevtutil qe Application /f:TEXT > Application_log.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment