// SystemShutdown.cpp : メイン プロジェクト ファイルです。 #include "stdafx.h" using namespace System; using namespace System::Diagnostics; int main(array ^args) { ProcessStartInfo^ psi = gcnew ProcessStartInfo(); psi->FileName = "shutdown.exe"; //コマンドラインを指定 psi->Arguments = "-s"; // -r:再起動 //psi->Arguments = "-r"; // -l:ログオフ //psi->Arguments = "-l"; //ウィンドウを表示しないようにする(こうしても表示される) psi->CreateNoWindow = true; //起動 Process::Start(psi); return 0; }