diff --git a/script/setup.cmd b/script/setup.cmd new file mode 100644 index 0000000..32c6ed9 --- /dev/null +++ b/script/setup.cmd @@ -0,0 +1,20 @@ +@echo off +set dir=%~dp0 +cd %dir% +schtasks /create /tn "Dislocker_Client" /tr "%dir%dislocker_client.exe" /sc onlogon /ru "%USERNAME%" /rl highest /f +if %ERRORLEVEL% == 0 ( + echo タスクスケジューラーの設定は完了しました。 +) +if %ERRORLEVEL% == 1 ( + echo タスクスケジューラーの設定でエラーが発生しました。 +) +Cscript "%dir%shortcut.vbs" "%dir%" "dislocker_client.exe" "stop" "%USERNAME%" +if %ERRORLEVEL% == 0 ( + echo ショートカットの作成は完了しました。 +) +if %ERRORLEVEL% == 1 ( + echo ショートカットの作成でエラーが発生しました。 +) +set /P pc_number=PC番号を入力 +start %dir%dislocker_client.exe setup %pc_number% +pause \ No newline at end of file diff --git a/script/shortcut.vbs b/script/shortcut.vbs new file mode 100644 index 0000000..e5caf2b --- /dev/null +++ b/script/shortcut.vbs @@ -0,0 +1,8 @@ +Set WshShell = CreateObject("WScript.Shell") +Set args = Wscript.Arguments +Set Shortcut = WshShell.CreateShortcut(args(0) & "\シャットダウンと終了処理.lnk") +Shortcut.TargetPath = args(0) & args(1) +Shortcut.Arguments = args(2) +Shortcut.WorkingDirectory = args(0) +Shortcut.Save +WScript.Quit(0) \ No newline at end of file