当我尝试下面的命令来运行获得“失踪表达元运算符后‘ - ’”当我尝试运行PowerShell脚本
C:\Documents and Settings\BURE\My Documents\ibos\script>powershell.exe -NoProfile -WindowStyle Hidden & 'C:\Documents and Settings\BURE\My Documents\ibos\script\files_from_nomad.ps1' 1
我获得以下错误
Missing expression after unary operator '-'.
At line:1 char:2
+ - <<<< WindowStyle Hidden
The filename, directory name, or volume label syntax is incorrect.
它的工作原理之前, 但是不是现在? 为什么?
我试图做的是schadular脚本:
schtasks /CREATE /RU BURE /SC MINUTE /TN files_to_nomad /TR "powershell.exe -NoProfile -WindowStyle Hidden & 'C:\Documents and Settings\BURE\My Documents\ibos\script\files_to_nomad.ps1' 1"
我有确切的另一台计算机上相同的程序器。
不应该'&'是要么逃跑或引用?否则'cmd'会将其作为命令分隔符。 – Joey 2010-02-04 18:09:01
它不解决它。它做到这一点之前这样做 – magol 2010-02-05 10:06:47