インストールから windows-update サービスを無効にする必要があります。私はすでに vbscript を使用していくつかのことを行っているので、vbscript で実行したいと考えています。
vbscript (またはその他のスクリプト言語) に関する私の知識は非常に限られているため、誰か助けてもらえますか? 本当に感謝します!
ありがとう。
インストールから windows-update サービスを無効にする必要があります。私はすでに vbscript を使用していくつかのことを行っているので、vbscript で実行したいと考えています。
vbscript (またはその他のスクリプト言語) に関する私の知識は非常に限られているため、誰か助けてもらえますか? 本当に感謝します!
ありがとう。
トマラクとパトリック・カフに感謝します。本当にありがとうございました。これは良い完全な答えになると思います。
方法 1: マシンの起動時に「自動更新」サービスが自動的に開始されないようにします。
strComputer = "." 'could be any computer, not just the local one '
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name = 'wuauserv'")
For Each objService in colServiceList
objService.ChangeStartMode("Disabled")
Next
方法 2: [自動更新] 構成を [自動] から [自動更新を無効にする] に変更します。(MSDN には、他の NotificationLevel 定数が一覧表示されています)
Const AU_DISABLED = 1
Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
Set objSettings = objAutoUpdate.Settings
objSettings.NotificationLevel = AU_DISABLED
objSettings.Save
どちらの場合も、自動更新は行われません。方法 1 では開始されませんが、方法 2 ではサービスがまだ実行されており、何もしていません。
GUI を使用して、これらの両方を行うことができます。
Tomalakありがとう。
私はまたそれを見つけました:
Const SCHEDULED_INSTALLATION = 1
Set objAutoUpdate = CreateObject("Microsoft.Update.AutoUpdate")
Set objSettings = objAutoUpdate.Settings
objSettings.NotificationLevel = SCHEDULED_INSTALLATION
objSettings.Save
これはリンクです:http://www.microsoft.com/technet/scriptcenter/resources/tales/sg0705.mspx
VBScriptを使用する場合は、WMIを使用します。
strComputer = "." 'could be any computer, not just the local one '
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name = 'wuauserv'")
For Each objService in colServiceList
objService.ChangeStartMode("Disabled")
Next
WMI Win32_Serviceクラスのドキュメントを調べて、他に何ができるかを確認してください。
より簡単なのは:の使用sc.exe
です
sc config wuauserv start = auto
これができることの抜粋sc.exe
です:
C:\>sc config
Modifies a service entry in the registry and Service Database.
SYNTAX:
sc <server> config [service name] <option1> <option2>...
CONFIG OPTIONS:
NOTE: The option name includes the equal sign.
type= <own|share|interact|kernel|filesys|rec|adapt>
start= <boot|system|auto|demand|disabled>
error= <normal|severe|critical|ignore>
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
DisplayName= <display name>
password= <password>