我有一个.ps1脚本,用于以不同的用户身份打开powershell的新实例:
runas /netonly /user:******\******* powershell直到今天,它仍然正常工作,但现在它返回了以下错误:
Attempting to start powershell as user "*******\********" ...
RUNAS ERROR: Unable to run - powershell
2: The system cannot find the file specified.以前有没有其他人遇到过这个错误,有任何已知的修正吗?
发布于 2022-03-17 04:08:02
这里的操作:解决了这个问题,我没有意识到我意外地覆盖了PATH Local变量。对于未来像我这样可怜的人来说,解决办法是:
系统属性->高级选项卡->环境变量->系统变量:路径->添加C:\windows\ System 32\WindowsPowerShell\v1.0
不过,我相信还有更好的解决办法
https://stackoverflow.com/questions/71506402
复制相似问题