无法执行批处理文件中的所有命令
Not able to execute all commands in my batch file
下面是我的批处理脚本:
@echo off
cd "C:\Users\SXR1176\AppData\Roaming\npm"
set /p Product= Enter Product :
set /p Organization= Enter Organization :
set /p Server= Enter Server:
echo Product %Product%
echo Organization %Organization%
echo Server %Server%
cmd /k apic login
cmd
apic drafts:pull %Product% --organization %Organization% --server %Server%
pause
上述批处理文件的输出如下:
Enter Product : sendfax-from-dev-faxutilitywsdl-product:1.0.0
Enter Organization : demoOrg
Enter Server: dummyserver.com
Product sendfax-from-dev-faxutilitywsdl-product:1.0.0
Organization demo
Server dummyserver.com
Enter the API Connect server
? Server: dummyserver.com
? Username: username
? Password (typing will be hidden) *******
Logged into dev-apic.humana.com successfully
C:\Users\SXR1176\AppData\Roaming\npm>
我看到在执行 apic 登录命令后,根本没有执行下一个命令(apic 草稿)。你能告诉我发生了什么事吗?
不确定为什么要执行 cmd /k
和奇怪的 cmd
,但请尝试一下:
@echo off
cd /d "C:\Users\SXR1176\AppData\Roaming\npm"
set /p "product=Enter Product : "
set /p "organization=Enter Organization : "
set /p "server=Enter Server: "
echo Product %product%
echo Organization %organization%
echo Server %server%
call apic login
call apic drafts:pull %product% --organization %organization% --server %server%
pause
然后说。我有点不确定这里需要发生什么。我没有 apic,所以我无法复制这个问题,所以让我们看看答案如何。我怀疑 apic 可能在 cmd 范围之外。
下面是我的批处理脚本:
@echo off
cd "C:\Users\SXR1176\AppData\Roaming\npm"
set /p Product= Enter Product :
set /p Organization= Enter Organization :
set /p Server= Enter Server:
echo Product %Product%
echo Organization %Organization%
echo Server %Server%
cmd /k apic login
cmd
apic drafts:pull %Product% --organization %Organization% --server %Server%
pause
上述批处理文件的输出如下:
Enter Product : sendfax-from-dev-faxutilitywsdl-product:1.0.0
Enter Organization : demoOrg
Enter Server: dummyserver.com
Product sendfax-from-dev-faxutilitywsdl-product:1.0.0
Organization demo
Server dummyserver.com
Enter the API Connect server
? Server: dummyserver.com
? Username: username
? Password (typing will be hidden) *******
Logged into dev-apic.humana.com successfully
C:\Users\SXR1176\AppData\Roaming\npm>
我看到在执行 apic 登录命令后,根本没有执行下一个命令(apic 草稿)。你能告诉我发生了什么事吗?
不确定为什么要执行 cmd /k
和奇怪的 cmd
,但请尝试一下:
@echo off
cd /d "C:\Users\SXR1176\AppData\Roaming\npm"
set /p "product=Enter Product : "
set /p "organization=Enter Organization : "
set /p "server=Enter Server: "
echo Product %product%
echo Organization %organization%
echo Server %server%
call apic login
call apic drafts:pull %product% --organization %organization% --server %server%
pause
然后说。我有点不确定这里需要发生什么。我没有 apic,所以我无法复制这个问题,所以让我们看看答案如何。我怀疑 apic 可能在 cmd 范围之外。