Last active
December 15, 2015 03:39
-
-
Save stuartwakefield/5195691 to your computer and use it in GitHub Desktop.
Starting to log processes for my Win PC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Put this somewhere sensible open up the Task Scheduler create a new | |
:: task to run this batch file on a regular interval | |
@echo off | |
set DIRPATH=%~dp0 | |
:: Create a timestamp for the file | |
set TS=%date:~-4,4%%date:~-7,2%%date:~-10,2%-%time:~0,2%%time:~3,2%%time:~6,2%-%time:~9,2% | |
:: Create the log directory if it doesn't exist | |
if not exist %DIRPATH%log ( | |
mkdir %DIRPATH%log | |
) | |
:: List processes to file | |
call wmic process list > %DIRPATH%log/process-%TS%.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment