とある PC のとあるユーザでは、タイマー設定で shutdown -l するようなごく簡単なスクリプトを、スタートアップで実行しています。
なんですが、このスクリプトをキャンセルするコトを使用者が覚えてしまったため、対抗策を考え中です。(w
何かツールでも探しましょうかね。
ところで、これで shutdown コマンドのヘルプを見ていたら、-i オプションなるもの↓があるのを見つけました。
(図1)
shutdown コマンド -i オプション。 (画像サイズ 16KB)
GUI でパラメータ設定出来るのですね。φ(.. )
試してみたら、ローカルでやる場合でもコンピュータ名は要求されました。
(覚え書き)
Z:\>shutdown
使用法: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\コンピュータ名] [-t xx] [-c "コメント"] [-d up:xx:yy]引数なし このメッセージを表示します (-? と同じです)
-i GUI インターフェイスを表示します。このオプ
ションは最初に指定する必要があります
-l ログオフ (-m オプションとは併用できません)
-s コンピュータをシャットダウンします
-r コンピュータをシャットダウンして再起動します
-a システム シャットダウンを中止します
-m \\コンピュータ名 シャットダウン/再起動/中止するリモート コン
ピュータの名前です
-t xx シャットダウンのタイムアウトを xx 秒に設定
します
-c "コメント" シャットダウンのコメントです (127 文字まで)
-f 実行中のアプリケーションを警告なしに閉じます
-d [u][p]:xx:yy シャットダウンの理由コードです
u = ユーザー コード
p = 計画されたシャットダウンのコード
xx = 重大な理由コード (255 以下の正の整数)
yy = 重大ではない理由コード (65535 以下の正の
整数)Z:\>chcp 437
Active code page: 437Z:\>shutdown
Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)Z:\>
※ chcp 437 の代わりに us コマンドでも 可
(おまけ)
とりあえず、別のマシンからリモートで shutdown -r -f -m してみたりしてみました。
当面これで行きましょうかね、手動ですけど。(w
-l オプションと -m オプションを組み合わせられると良いのですが、まあそこまでやるなら「管理ツール」経由ですね。
あとローカルで試してみた結果、-t も -l とは組み合わせられないみたいでした。
また -r -t にすると「権限がない」と言われました。※ 対象は制限ユーザです。
ところで、スタンバイにするには、powrprof.dll を使うのですね。
C:\>%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
ですか。φ(.. )
いじょうです。
-
- -