我正忙着编写一个cmd程序(使用Windows并将cmd作为一个管理程序运行),该程序将执行以下操作:
该方案如下:
@ECHO OFF
color a
: Begin
IF %Time% /t GTQ 01:15 && %Time% /t LEQ 01:20 (GOTO END) <---- problem is here
% %
% Date stamp the log entry and copy values. Wait 3 min before redoing the scan and check time %
% %
Time /t >> C:\Users\Paimon\Desktop\"WIFI data.txt"
Date /t >> C:\Users\Paimon\Desktop\"WIFI data.txt"
netstat -n
netstat -n >> C:\Users\Paimon\Desktop\"WIFI data.txt"
timeout /t 180
cls
GOTO Begin
:END
exit我决定将时间与愤怒的值进行比较,因为程序每3分钟只执行一次这一行。
发布于 2014-11-04 06:18:17
您在有问题的行中有一些问题:
%time% /t不能工作
GTQ是不允许的运算符(使用GTR或GEQ)
你不能做if a && b then
一个很好的解决办法是:
if %time: =0% geq 01:15 if %time: =0% leq 01:20 goto endhttps://stackoverflow.com/questions/26725206
复制相似问题