整理.BAT 文件
我的下面的脚本运行正常,但基本上我希望 .bat 在输入赌场名称和用户名之前询问用户是否想要赌场列表,然后,如果他们选择 l
(小写字母 EL) 代表列表,它生成赌场列表。当前收到“转换退出值时出错”。谁能告诉我这个的代码吗?
@echo off
osql -STEMP7 -E -dAAMS888 -w256 -qEXIT("SET NOCOUNT ON SELECT casino_desc from casino") -b
set /p var1= Enter Casino Name :
set /p var2= Enter Screen name :
osql -STEMP7 -E -dAAMS888 -w256 -QEXIT("DECLARE @r int EXEC @r = usp_AddToObservationtbl '%var1%','%var2%' SELECT @r") -b -oc:\bat\observation.log
exit errorlevel
I have the script below which is performing correctly, but basically I want the .bat to ask the user if they want a list of casinos before entering the casino name and username, then, if they select l
(lower-case letter EL) for list, it produces the list of casinos. Currently getting 'error converting exit value'. Can anyone tell me the code for this?
@echo off
osql -STEMP7 -E -dAAMS888 -w256 -qEXIT("SET NOCOUNT ON SELECT casino_desc from casino") -b
set /p var1= Enter Casino Name :
set /p var2= Enter Screen name :
osql -STEMP7 -E -dAAMS888 -w256 -QEXIT("DECLARE @r int EXEC @r = usp_AddToObservationtbl '%var1%','%var2%' SELECT @r") -b -oc:\bat\observation.log
exit errorlevel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将该行更改
为
You Want to return the value of the
ERRORLEVEL
变量来修复退出值转换错误,因此您需要将名称括在%
s 中。至于您的第一个问题,关于要求用户确认是否要显示赌场列表,您可以尝试对原始脚本进行类似的修改(添加的行以粗体突出显示):
The exit value converting error is fixed by changing the line
to
You want to return the value of the
ERRORLEVEL
variable, so you need to enclose the name in%
s.As for you first question, about asking the user to confirm whether they want to display the list of casinos, you could try something like this modification of your original script (added lines are highlighted in bold):