- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经多次尝试让这个批处理工作,但它不会,这让我发疯。在我屈服于提出问题之前,我还梳理了这个网站并尝试了许多不同的事情。
我有一个批处理程序会根据您的选择执行关机或重启或注销。当我运行它并想通过检查答案以查看它是否为零来从几小时移动到几分钟再到几秒时,问题就出现了。它给出了错误“有一个意外的(”并立即关闭。如果我把它拆开并单独运行它,它就会工作。
这是包含 If 语句的主函数。如果你想看整批,我可以给你。我已经注释掉了 shutdown 的实际使用,只是为了帮助解决这个问题。 REM'd out shutdown 行之前的 2 行将在解决后删除。
:SR_MAIN
cls
echo+
echo+
set /p SR_hrs=....Please enter the number of hours before %SR_NAME%:
IF "%SR_hrs%" == 0 (
echo+
echo You don't want hours, huh?
timeout /t 2 > nul
cls
echo+
echo+
set /p ptm=....Please enter the number of minutes before %SR_NAME%:
IF %ptm% == 0 (
echo+
echo You don't want minutes, huh?
timeout /t 2 > nul
cls
echo+
echo+
set /p pts=....Please enter the number of seconds before %SR_NAME%:
IF %pts% == 0 (
echo+
echo Exiting to Shutdown menu...
timeout /t 2 > nul
goto SHUTREMENU
) ELSE (
cls
echo+
echo+
echo This will %SR_NAME% the computer in the seconds you provided.
set /a tm=pts
echo+
echo Waiting %tm% seconds before continuing...
echo+
timeout /t %tm%
echo Now would come the %SR_NAME%!
pause
REM shutdown /f /%SR_N% /t 0
exit
)
) ELSE (
cls
echo+
echo+
echo This will %SR_NAME% the computer in the minutes you provided.
set /a tm=ptm*60
echo+
echo Waiting %ptm% minutes (%tm% seconds) before continuing...
echo+
timeout /t %tm%
echo Now would come the %SR_NAME%!
pause
REM shutdown /f /%SR_N% /t 0
exit
)
) ELSE (
cls
echo+
echo+
echo This will %SR_NAME% the computer in the hours you provided.
set /a tm=SR_hrs*60*60
echo+
echo Waiting %SR_hrs% hours (%tm% seconds) before continuing...
echo+
timeout /t %tm%
echo Now would come the %SR_NAME%!
pause
REM shutdown /f /%SR_N% /t 0
exit
)
:MAIN_MENU
ECHO Exiting to Main Menu...
PAUSE
感谢您提供的任何帮助。这对我来说是一个真正的难题。
J
最佳答案
缺少一个百分号。
IF "%SR_hrs%" == 0 (
↑ there
关于if-statement - 批量处理多个 If,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12699314/
在 go lang 中使用“If with a short statement”有什么好处。引用:go tour if v := math.Pow(x, n); v < lim { retur
完全错误: Warning: Unsafe statement written to the binary log using statement format since BINLOG_FORMAT
完全错误: Warning: Unsafe statement written to the binary log using statement format since BINLOG_FORMAT
我有三个存储过程 Sp1、Sp2 和 Sp3。 第一个 (Sp1) 将执行第二个 (Sp2) 并将返回的数据保存到 @tempTB1 中,第二个将执行第三个 (Sp3) 并将数据保存到 @tempTB
我已将 FLAG 设置为 1,并且正在执行 ARG 值应该仅为 DEV。但是我得到的是 ARG= DEV + CLIENTID 000023 // FLAG=1 000026 // I
我已将 FLAG 设置为 1,并且正在执行 ARG 值应该仅为 DEV。但是我得到的是 ARG= DEV + CLIENTID 000023 // FLAG=1 000026 // I
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
PMD告诉我 A switch with less than 3 branches is inefficient, use a if statement instead. 这是为什么呢?为什么是3?他
我刚开始学习 Racket,所以我仍在努力弄清楚这门语言的复杂性。我正在尝试在列表中实现我自己的搜索功能。如果函数找到它,则返回索引,否则返回 -1。 (define (find-index list
在 Kotlin 中,您可以使用类似于三元运算符的 if 语句。 我们可以选择做这样的事情: val x = if (isOdd) 1 else 2 但是如果我们有多个变量需要根据某些条件进行设置,那
在我的 Android 应用程序中,我尝试使用 XMLPullParser 使用以下代码读取 xml 文件: while (eventType != XmlPullParser.END_DOCUMEN
这个问题已经有答案了: Boolean expressions in Java (8 个回答) 已关闭 7 年前。 我遇到过一些情况,其中第一个似乎改变了 boolean 值,而第二个却没有!两者之间
我基本上想做的是: select * from request where id = 1 and created_at like (today's date); 但使用 Eloquent 。 我试过:
我不确定为什么会收到此代码。基本上我希望能够动态定位我的发射器,但是当我添加一个选项来检查位置并根据需要进行纠正时,我不断收到此错误。 添加的代码是 if (
何时使用语句而不是准备语句。我想语句用于没有参数的查询,但为什么不使用准备好的语句呢?对于没有参数的查询,哪个更快。 最佳答案 I suppose statement is used in queri
我必须创建一个表,如下所示 借款人(客户编号,贷款编号) 如果客户没有超过 3 笔贷款,则可以贷款。 我创建的表如下 create table borrower( customerno int(5),
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicates: Is "else if" faster than "switch() case"? What is the
typescript 版本 2.2.2 我在我的 UserRoutzr.ts 中写了这个要求 const users = require(path.join(process.cwd() + "/da
我有一个用 JPQL 编写的应用程序,它可以命中非常不同的查询(在不同的资源上)。 对于很多此类查询,我需要知道结果总数(计数),因为我没有应用任何 LIMIT/OFFSET 由于此查询的性质非常不同
我对以下 Java 语句感到困惑: ArtClass artClass0 = new ArtClass(); int int3 = 73; boolean boolean0 = artClass0.f
我是一名优秀的程序员,十分优秀!