问题描述
@echo off
Title Ping
color b
echo Enter the website you would like to ping
set input=
set /p input= Enter your Website here:
color d
echo Enter the password for the program
set input2=
set /p input2= Enter the Pass here:
color b
IF [input2] EQU [1234]
它应该检查 Input2
是否等于 1234
,如果是,脚本应该继续,如果它不等于 1234
就应该等待。
我想这很简单,但我似乎没有让它工作。脚本也只是在最后一行代码之后崩溃。
解决方法
好的,我花了一些时间在代码上,我想我现在完成了。
@echo off
Title Ping
color b
echo Enter the website you would like to ping
set input=
set /p input= Enter your Website here:
set input2=
set /p input2= Enter Password here:
if /I "%input2%" NEQ "1234" GOTO END
setlocal
:PROMPT
set AREYOUSURE=
SET /P AREYOUSURE=Are you sure (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
set x=
set /p x= How many times you like to ping?
color c
cls
echo -------------------------------------------------------------
echo now pinging %input% %x% times press strg + c to cancel
echo -------------------------------------------------------------
color a
ping -l 65500 -n %x% %input%
:end
endlocal