这个是我用的一个菜单改了一下,代码有点烦杂,看你能不能用?
@echo off
title 安装杀毒软件
color 1a
set ttzzcode=%random%
set s=3
set /a run1=run1+1
cls
if %run1% equ 2 goto :onstart
del %temp%\ttzz%ttzzcode%.txt >nul 2>nul
start "安装杀毒软件 - 30" /b cmd /c %0
:select
cls
echo 请选择
echo -------------------------
echo 1,安装杀毒软件
echo 2,不安装杀毒软件
echo -----------%s%-------------
if %run1% equ 2 goto :onstart1
set /a s=s-1
if %s% lss 0 goto :overit
set /p game=
if %game% equ 1 goto :g1
if %game% equ 2 goto :g2
echo 请正确选择!
ping 127.0.0.1 -n 1 >nul 2>nul
goto :select
exit
:g1
start cmd /c "安装杀毒软件的代码"
goto overit
exit
:g2
goto overit
exit
:onstart
goto :select
:onstart1
set timenum=30
:timestart
title 安装杀毒软件 - %timenum%
if exist %temp%\ttzz%ttzzcode%.txt goto :overkill
if %timenum% gtr 0 goto :goon
:overkill
del %temp%\ttzz%ttzzcode%.txt >nul 2>nul
taskkill /fi "windowtitle eq 安装杀毒软件 - 0" /f >nul 2>nul
exit
:goon
set /a timenum=timenum-1
ping 127.0.0.1 -n 2 >nul 2>nul
goto :timestart
exit
:overit
@echo Over >%temp%\ttzz%ttzzcode%.txt 2>nul
exit