用bat打开windows powershell窗口后 在新窗口中继续执行命令
bat吧
全部回复
仅看楼主
level 2
砍柴人exm😈
楼主
用bat打开windows powershell窗口后 在windows powershell窗口中继续执行bat中命令 就是我想代码全部写好在bat中,双击运行bat就可以打开使用windows powershell自动执行文本中的命令 比如我要新建用户名 需要在windows powershell才有权限可以新建
2019年01月18日 13点01分
1
level 2
砍柴人exm😈
楼主
我顶
2019年01月20日 08点01分
2
level 2
砍柴人exm😈
楼主
我再顶
2019年01月20日 13点01分
3
level 6
ME-O
为什么不试试
Powershell -command XXX
格式呢?
在CMD.EXE用Powershell /?查看帮助
PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>]
[-NoLogo] [-NoExit] [-Sta] [-NoProfile] [-NonInteractive]
[-InputFormat {Text | XML}] [-OutputFormat {Text | XML}]
[-WindowStyle <style>] [-EncodedCommand <Base64EncodedCommand>]
[-File <filePath> <args>] [-ExecutionPolicy <ExecutionPolicy>]
[-Command { - | <script-block> [-args <arg-array>]
| <string> [<CommandParameters>] } ]
PowerShell[.exe] -Help | -? | /?
如果是要直接用Powershell运行那就拓展名保存为.ps1,然后:
cmd:
Start Powershell.exe *.ps1
2019年01月20日 13点01分
4
ME-O
补充: Start Powershell.exe -Command XXX的格式也是可以的。
2019年01月20日 13点01分
砍柴人exm😈
我想用以管理员身份运行的powershell需要怎么弄
2019年01月24日 09点01分
ME-O
以管理员权限运行CMD或Powershell的方法百度,不需要我说了
2019年01月24日 10点01分
柠檬天天甜
别人是要在bat里面执行所有的命令
2020年05月16日 07点05分
1