标题: [文本处理] 批处理怎样提取文本指定字符? [打印本页]
作者: smss 时间: 2020-12-4 13:19 标题: 批处理怎样提取文本指定字符?
文本A- # Enable automatic restart after Windows Update installation
- Function EnableUpdateRestart {
- Write-Output "Enabling Windows Update automatic restart..."
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MusNotification.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:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" -Name "WakeUp" -Type DWord -Value 0
- }
复制代码
提取Write-Output "之间的字符"
生成文本B
Enabling Windows Update automatic restart...
Disabling nightly wake-up for Automatic Maintenance...
翻译得到文本C 替换掉文本A Write-Output "之间的字符"
正在启用Windows Update自动重启...
禁用夜间唤醒以进行自动维护...
希望WHY老师教下 我比较笨最好备注下 谢谢老师
作者: xczxczxcz 时间: 2020-12-4 17:32
坐沙发,路过。。。
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |