' Set objShell = CreateObject("WScript.Shell") 'ファイル設定 'サービス一覧 keyfile = objShell.SpecialFolders("Desktop") & "\" & "サービス一覧.txt" 'コマンド出力 stopbat = objShell.SpecialFolders("Desktop") & "\" & "サービスの停止コマンドバッチ.bat" 'サービス一覧の取得 cmd ="%ComSpec% /c sc queryex state= all > " & """" & keyfile & """" objShell.run cmd ,0,True Set objFso = CreateObject("Scripting.FileSystemObject") Set objFile = objFso.OpenTextFile(keyfile, 1, False) 'サービス一覧配列 Dim arrKeyList Set arrKeyList = CreateObject("System.Collections.ArrayList") 'ストップサービス一覧 Dim arrStopList Set arrStopList = CreateObject("System.Collections.ArrayList") '出力コマンド Dim arrStopTarget Set arrStopTarget = CreateObject("System.Collections.ArrayList") If Err.Number > 0 Then WScript.Echo "Open Error" Else Do Until objFile.AtEndOfStream arrKeyList.add(objFile.ReadLine)' & vbCrLf Loop End If '停止サービスセット arrStopList.Add("ActiveX Installer (AxInstSV)") arrStopList.Add("Adobe Acrobat Update Service") arrStopList.Add("AllJoyn Router Service") arrStopList.Add("Application Layer Gateway Service") arrStopList.Add("BitLocker Drive Encryption Service") arrStopList.Add("Bluetooth オーディオ ゲートウェイ サービス") arrStopList.Add("Bluetooth サポート サービス") arrStopList.Add("COM+ System Application") arrStopList.Add("Certificate Propagation") arrStopList.Add("Connected Devices Platform Service") arrStopList.Add("Connected User Experiences and Telemetry") arrStopList.Add("Data Sharing Service") arrStopList.Add("Delivery Optimization") arrStopList.Add("Distributed Link Tracking Client") arrStopList.Add("Distributed Transaction Coordinator") arrStopList.Add("Downloaded Maps Manager") arrStopList.Add("File History Service") arrStopList.Add("Geolocation Service") arrStopList.Add("Google Update サービス (gupdate)") arrStopList.Add("Google Update サービス (gupdatem)") arrStopList.Add("GraphicsPerfSvc") arrStopList.Add("HV ホスト サービス") arrStopList.Add("Human Interface Device Service") arrStopList.Add("Hyper-V Data Exchange Service") arrStopList.Add("Hyper-V Guest Service Interface") arrStopList.Add("Hyper-V Guest Shutdown Service") arrStopList.Add("Hyper-V Heartbeat Service") arrStopList.Add("Hyper-V PowerShell Direct Service") arrStopList.Add("Hyper-V Time Synchronization Service") arrStopList.Add("Hyper-V ボリューム シャドウ コピー リクエスター") arrStopList.Add("Hyper-V リモート デスクトップ仮想化サービス") arrStopList.Add("IP 変換構成サービス") arrStopList.Add("KtmRm for Distributed Transaction Coordinator") arrStopList.Add("Link-Layer Topology Discovery Mapper") arrStopList.Add("Microsoft (R) 診断ハブ標準コレクター サービス") arrStopList.Add("Microsoft Software Shadow Copy Provider") arrStopList.Add("Microsoft Windows SMS ルーター サービス。") arrStopList.Add("Microsoft iSCSI Initiator Service") arrStopList.Add("Net.Tcp Port Sharing Service") arrStopList.Add("Network Connected Devices Auto-Setup") arrStopList.Add("Network Connection Broker") arrStopList.Add("Network Connections") arrStopList.Add("OpenSSH Authentication Agent") arrStopList.Add("Peer Name Resolution Protocol") arrStopList.Add("Peer Networking Grouping") arrStopList.Add("Peer Networking Identity Manager") arrStopList.Add("Performance Logs & Alerts") arrStopList.Add("Phone Service") arrStopList.Add("Portable Device Enumerator Service") arrStopList.Add("Problem Reports and Solutions Control Panel Support") arrStopList.Add("Program Compatibility Assistant Service") arrStopList.Add("Remote Access Auto Connection Manager") arrStopList.Add("Remote Access Connection Manager") arrStopList.Add("Remote Desktop Configuration") arrStopList.Add("Remote Desktop Services") arrStopList.Add("Remote Desktop Services") arrStopList.Add("Remote Desktop Services UserMode Port Redirector") arrStopList.Add("Remote Procedure Call (RPC) Locator") arrStopList.Add("Remote Registry") arrStopList.Add("Routing and Remote Access") arrStopList.Add("SSDP Discovery") arrStopList.Add("Sensor Data Service") arrStopList.Add("Sensor Monitoring Service") arrStopList.Add("Sensor Service") arrStopList.Add("Shared PC Account Manager") arrStopList.Add("Smart Card") arrStopList.Add("Smart Card") arrStopList.Add("Smart Card") arrStopList.Add("Smart Card Device Enumeration Service") arrStopList.Add("Smart Card Removal Policy") arrStopList.Add("Still Image Acquisition Events") arrStopList.Add("Telephony") arrStopList.Add("Themes") arrStopList.Add("Touch Keyboard and Handwriting Panel Service") arrStopList.Add("WWAN AutoConfig") arrStopList.Add("WalletService") arrStopList.Add("Web アカウント マネージャー") arrStopList.Add("Wi-Fi Direct サービスの接続マネージャー サービス") arrStopList.Add("Windows Biometric Service") arrStopList.Add("Windows Encryption Provider Host Service") arrStopList.Add("Windows Error Reporting Service") arrStopList.Add("Windows Event Collector") arrStopList.Add("Windows Image Acquisition (WIA)") arrStopList.Add("Windows Insider サービス") arrStopList.Add("Windows Media Player Network Sharing Service") arrStopList.Add("Windows PushToInstall サービス") arrStopList.Add("Windows Remote Management (WS-Management)") arrStopList.Add("Windows Search") arrStopList.Add("Windows カメラ フレーム サーバー") arrStopList.Add("Windows バックアップ") arrStopList.Add("Windows プッシュ通知システム サービス") arrStopList.Add("Windows モバイル ホットスポット サービス") arrStopList.Add("Windows 認識サービス") arrStopList.Add("Workstation") arrStopList.Add("Xbox Accessory Management Service") arrStopList.Add("Xbox Live Auth Manager") arrStopList.Add("Xbox Live セーブ データ") arrStopList.Add("Xbox Live ネットワーキング サービス") arrStopList.Add("タイム ゾーンの自動更新機能") arrStopList.Add("デバイス管理登録サービス") arrStopList.Add("データ使用状況") arrStopList.Add("保護者による制限") arrStopList.Add("容積オーディオ コンポジター サービス") arrStopList.Add("市販デモ サービス") arrStopList.Add("支払いおよび NFC/SE マネージャー") arrStopList.Add("機能アクセス マネージャー サービス") arrStopList.Add("無線管理サービス") arrStopList.Add("空間データ サービス") arrStopList.Add("自然認証") arrStopList.Add("言語エクスペリエンス サービス") '稼動サービスキー名確認 For s=0 To arrStopList.count-1 For i=0 To arrKeyList.count-1 keyStopStr ="DISPLAY_NAME: " & arrStopList(s) if inStr(arrKeyList(i), keyStopStr)>0 then servkey =mid(arrKeyList(i-1),15) arrStopTarget.add(":" & arrStopList(s)) arrStopTarget.add("sc stop " & servkey) arrStopTarget.add(":sc config " & """" & servkey & """" & " start= disabled " ) arrStopTarget.add("" ) end if Next Next '停止コマンドバッチ書き出し if arrStopTarget.count >0 then Set tso = objFso.OpenTextFile(stopbat, 2, true) For i=0 To arrStopTarget.count-1 tso.WriteLine(arrStopTarget(i)) next tso.WriteLine("Pause") tso.Close Wscript.echo "停止対象サービスの停止コマンドバッチを(デスクトップに)作成しました" & vbCrLf & "みあたらないときはF5を押してみてください" else Wscript.echo "停止対象サービスはありません" end if objFile.Close Set objFile = Nothing Set objFso = Nothing