我已经在这个脚本上工作了一段时间,我对编写批处理文件还很陌生。我知道我的语法错了,需要帮助。

@echo off
setlocal enabledelayedexpansion
set "ports=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports"
for /f %%I in ( 'reg query "%ports%"')
do (
    echo %%I | findstr /i "c:\\convertdoc\\output\\silentprinttemp\\.*\.ps" >NUL
    IF ERRORLEVEL 1  reg delete "%ports%" /v "%%I" /f
)

最佳答案

@echo off
setlocal
set "ports=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports"
for /f %%I in (
    'reg query "%ports%"'
        ) do (
    echo %%I | findstr /i "c:\\convertdoc\\output\\silentprinttemp\\.*\.ps" >NUL
    IF ERRORLEVEL 1  reg delete "%ports%" /v "%%I" /f
)

关于windows - 批量发行语法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17305617/

10-12 20:53