简体   繁体   English

在第一个命令仍从批处理文件运行时启动第二个命令

[英]Starting a second command while the first is still running from a batch file

I am trying to create a batch file that will run a utility that opens a connection to a device on the internet then starts a telnet session. 我正在尝试创建一个批处理文件,该文件将运行一个实用程序,该实用程序打开与Internet上设备的连接,然后启动telnet会话。 I am at the point where once the connection opens the batch file doesn't proceed. 我的意思是,一旦连接打开,批处理文件就不会继续。

Batch file 批处理文件

@echo off  
set /p serial=What are the last 8 of the STB's serial?   

udp.exe -c 127.0.0.1 23 %serial% x.x.x.x 11111 127.0.0.1 23 | telnet 127.0.0.1

Output 输出量

What are the last 8 of the STB's serial? XXXXXXX  
Ready for XXXXXXX

It just sits at the 'ready ...' line and never opens the telnet connection. 它只位于“ ready ...”行,从不打开telnet连接。 I have tried various | 我尝试过各种| and & but no luck. 和&但没有运气。

Would start /B help? 启动/ B会有所帮助吗?

Start /? 开始/? gives

Starts a separate window to run a specified program or command.

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/B] [command/program]
      [parameters]

    "title"     Title to display in  window title bar.
    path        Starting directory
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM