6,850
社区成员
发帖
与我相关
我的任务
分享
@echo off
set "rpath=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
for /f "delims=" %%i in ('reg query "%rpath%" /v ProductName ^| findstr "ProductName"') do (
set "OS=%%i"
)
:Win7
echo %OS% | findstr /c:"Windows 7" > nul
if errorlevel 1 (
goto :XP
) else (
del /f /q a.txt
)
goto :end
:XP
echo %OS% | findstr /c:"Windows XP" > nul
if errorlevel 1 (
goto :end
) else (
del /f /q b.txt
)
goto :end
:end
pause