创建了一个选择批处理文件来启动带有参数的自定义脚本:不起作用
我创建了一个脚本,该脚本将为用户提供从同一程序运行哪个操作的选择。问题是,创建我调用的程序的人设置的参数没有像 / 或 - 这样的开关。每当我运行批处理并尝试调用正确的操作时,只有可执行文件在没有参数的情况下运行,并且我尝试了多种引用和取消引用的方法。这是该批次,其中删除了一些 NDA 目录和应用程序名称,这样我就不会失去工作。
@echo off
cls
:start
echo.
echo 1. EXPORT
echo 2. EXPORT AP
echo 3. EXPORT CLASS ALL
echo 4. EXPORT CLASS STORE
echo 5. EXPORT PLUBATCH ALL
echo 6. EXPORT PLUBATCH STORE
echo 7. EXPORT STORE
echo 8. EXPORT TOUCH
echo 9. I'm Done
echo.
echo.
set /p x=Choose your fate:
IF '%x%' == '%x%' GOTO Item_%x%
:Item_1
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT
:Item_2
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT AP
:Item_3
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT CLASS ALL
:Item_4
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT CLASS STORE
:Item_5
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT PLUBATCH ALL
:Item_6
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT PLUBATCH STORE
:Item_7
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT STORE
:Item_8
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT TOUCH
:Item_9
pause
exit
每当我运行时,比如选择 2,它只执行应用程序的通用操作,就好像我根本没有运行任何参数一样。导出显然是一个命令,第二个参数列出了您希望程序导出的内容。有什么建议吗?
I've created a script that will offer the user a choice in which action to run from the same program. The problem is, the person who created the program I'm calling set parameters that do not have switches like / or -. Whenever I run the batch and try to call the correct action, only the executable runs without the parameters and I've tried multiple ways of quoting and unquoting. Here's the batch as it stands with some NDA directory and application names taken out so I dont lose my job.
@echo off
cls
:start
echo.
echo 1. EXPORT
echo 2. EXPORT AP
echo 3. EXPORT CLASS ALL
echo 4. EXPORT CLASS STORE
echo 5. EXPORT PLUBATCH ALL
echo 6. EXPORT PLUBATCH STORE
echo 7. EXPORT STORE
echo 8. EXPORT TOUCH
echo 9. I'm Done
echo.
echo.
set /p x=Choose your fate:
IF '%x%' == '%x%' GOTO Item_%x%
:Item_1
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT
:Item_2
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT AP
:Item_3
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT CLASS ALL
:Item_4
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT CLASS STORE
:Item_5
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT PLUBATCH ALL
:Item_6
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT PLUBATCH STORE
:Item_7
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT STORE
:Item_8
start "APP" /MIN /D"C:\Program Files\xxx\APP\W2" xxx.exe EXPORT TOUCH
:Item_9
pause
exit
Whenever I run, say Choice 2, it only does the generic actions of the application as if I'm running no parameters at all. Export is obviously a command and the second parameter lists what you'd like the program to export. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该是:
让我们尝试一个更简单的例子:
Should be:
Let's try a simpler example: