windows - 通过批处理文件启动 powershell 命令
问题描述
目前正在使用批处理文件。当 .bat 运行时 1. 打开特定的网站页面 2. 在目录中运行 powershell。
当我启动 .bat 时,有什么方法可以在 powershell 中自动输入命令?
这是我目前正在使用的,我想输入命令“node”。
@ECHO OFF
START "C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" https://stackoverflow.com
START powershell.exe -noexit -command "cd 'C:\Users\[User]\Desktop\File Directory\File in File\File in File in File'"
解决方案
Nevermind, I figured it out. A semicolon allows you to chain commands.
@ECHO OFF
START "C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" https://stackoverflow.com
START powershell.exe -noexit -command "cd 'C:\Users\[User]\Desktop\File Directory\File in File\File in File in File'"; "node ."
推荐阅读
- javafx - JavaFx WebView - 如何滚动到底部
- debugging - 在不进入函数调用的情况下进行调试 (gdb-peda)
- node.js - 使用 node.js 和 Cheerio 抓取 OP.GG 网站的问题
- sql - 在 SQL 中创建约束时,如何正确格式化从另一个表中提取的新表
- javascript - 如何在 Enzyme / React 中测试包含连接到 Redux 的组件的组件?
- r - 在R中将稀疏图从Vegan转换为ggplot2?
- sql - 从重叠的周期/到周期推导出连续的历史,有间隙
- google-api - Google API 后端错误 - 如果我们使用 Google Cloud 客户端库,我们会看到更少的后端错误吗?
- java - 仅删除表中的一行 - SpringBoot & Java & Thymeleaf
- node.js - 模型和关联如何与外键相关?