我想安排一个Powershell脚本,其参数与schtasks.exe中有一个空间。 (Powershell版本2,Windows 7)。铭记我在这个论坛上,我想出了这个表达式读过到PowerShell的命令行中输入:schtasks与Powershell和脚本与参数中的空间
schtasks.exe /create /f /tn "Mytaskname" /tr "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -command \`"& \`'D:\myscript.ps1\`' \`'D:\Filename with Space.xml\`'" /SD 08/04/2016 /ST 09:00 /RU domain\username /RP /SC ONCE
不幸的是这doesn'nt工作。如果我安排任务手动将其作品展示了我下面的条目在任务计划器:
PROGRAMM /脚本
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
添加参数(可选)
-command "& 'D:\myscript.ps1' ''D:\Filename with Space.xml '"
有人能帮忙吗? 在此先感谢