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

发布于 2024-10-12 15:13:46 字数 453 浏览 2 评论 0原文

我正在尝试创建一个批处理文件,该文件将运行一个实用程序,该实用程序打开与互联网上设备的连接,然后启动 telnet 会话。我现在的情况是,一旦连接打开,批处理文件就不会继续。

批处理文件

@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

输出

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

它只是位于“ready ...”行,并且从不打开 telnet 连接。我尝试过各种|和&但没有运气。

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. 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. I have tried various | and & but no luck.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍景流年 2024-10-19 15:13:46

开始 /B 有帮助吗?

开始 /?给出

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
...

Would start /B help?

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
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文