【问题标题】:batch file and localhost:5000批处理文件和 localhost:5000
【发布时间】:2017-10-04 13:00:17
【问题描述】:

我正在尝试编写一个批处理文件,该文件将使用这些命令启动我的 TCP 服务器和服务器。 到目前为止,我有:

if not "%minimized%"=="" goto :minimized
set minimized=true
@echo off

cd "C:path\to\my\foler"
REM Next command opens tcp-server.js and server
start node tcp-server.js
start node start.js  
start /d "C:path\to\my\foler" chrome.exe localhost:5000

现在,上面的这些也启动了 TCP 服务器和我的服务器,i。例如,如果在 Chrome 上输入 localhost:5000 等,它确实开始工作,但是:

  • 我想自动开始显示我希望它从中运行的页面。
  • 另外,我希望两个 nodejs 文件 tcp-server.jsstart.js 运行最小化。

【问题讨论】:

  • 您是否阅读了START 命令的帮助?可能会帮助您回答一些问题。
  • 感谢您的评论 - 我自己找到了解决方案;)

标签: node.js batch-file localhost


【解决方案1】:

再次 - 我找到了自己的解决方案 - 希望有一天它对某人有所帮助! :)

 @echo off

 cd "C:\path\to\the\folder"
 start /min node tcp-server.js
 start /min node start.js  
 start /d "C:\to\the\folder" chrome.exe 
 http://localhost:5000/folder/page.html%~n1%~x1

【讨论】:

    【解决方案2】:

    我没有足够的代表发表评论,但我希望有一天这也能帮助遇到类似问题的人,这样他们也可以像我一样解决上述问题的解决方案:

    @echo off
    start "C:/" chrome.exe http://localhost:40120
    pause
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-15
      • 2015-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-29
      • 1970-01-01
      相关资源
      最近更新 更多