
批處理怎樣提取文本指定字符文本A
提取Write-Output 之間的字符生成文本BEnabling Windows Update automatic restart...Disabling nightly wake-up for Automatic Maintenance...翻譯得到文本C 替換掉文本A Write-Output 之間的字符正在啟用Windows Update自動重啟...禁用夜間喚醒以進行自動維護...希望WHY老師教下 我比較笨最好備注下 謝謝老師nclick="copycode($('code0'));">復制代碼
- # Enable automatic restart after Windows Update installation
- Function EnableUpdateRestart {
- Write-Output Enabling Windows Update automatic restart...
- Remove-ItemProperty -Path HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionImage File Execution OptionsMusNotification.exe -Name Debugger -ErrorAction SilentlyContinue
- }
- # Disable nightly wake-up for Automatic Maintenance and Windows Updates
- Function DisableMaintenanceWakeUp {
- Write-Output Disabling nightly wake-up for Automatic Maintenance...
- If (!(Test-Path HKLM:SOFTWAREPoliciesMicrosoftWindowsWindowsUpdateAU)) {
- New-Item -Path HKLM:SOFTWAREPoliciesMicrosoftWindowsWindowsUpdateAU -Force | Out-Null
- }
- Set-ItemProperty -Path HKLM:SOFTWAREPoliciesMicrosoftWindowsWindowsUpdateAU -Name AUPowerManagement -Type DWord -Value 0
- Set-ItemProperty -Path HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionScheduleMaintenance -Name WakeUp -Type DWord -Value 0
- }

