LoginSignup
16
14

More than 5 years have passed since last update.

PCをシャットダウンした時間のリストを作成

Last updated at Posted at 2015-01-29

ずぼらサラリーマンシリーズ第2弾

PCをシャットダウンした時間のリストを作成します。
作成先はクリップボードなので実行前にクリップボードの内容を待避してください・
これで出勤簿をごにょごにょすればおーるおっけーです。

SHUTDOWNCHECK.cmd
set tempfile=%temp%\%RANDOM%.xml
echo ^<QueryList^> > %tempfile%
echo ^<Query Id="0" Path="System"^> >> %tempfile%
echo ^<Select Path="System"^>*[System[(EventID=6006)]]^</Select^> >> %tempfile%
echo ^</Query^> >> %tempfile%
echo ^</QueryList^> >> %tempfile%
wevtutil qe %tempfile% /sq:true /rd:true /f:text | find "Date"| SORT  | clip
del  %tempfile%
出力結果(クリップボード内容)
  Date: 2017-01-11T21:52:05.000
  Date: 2017-01-11T02:52:41.000
  Date: 2017-01-10T21:24:12.000
  Date: 2017-01-10T10:19:34.000
  Date: 2017-01-06T21:19:41.000
  Date: 2017-01-05T21:47:45.000
  Date: 2016-12-29T16:31:59.000
16
14
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
14