Mar*_*ven 5 batch-file windows-task-scheduler
我使用此命令来创建任务:
schtasks /Create /TN ITCMD-CHAT-NOTIF /SC ONLOGON /tr "%cd%\Notif\Notif.vbs" /F
然而出现了问题。当路径中有空格时,它仍然不会在操作周围添加引号。有没有办法在动作周围加上引号?
这可以通过嵌套两个不同的引号字符来完成。("'随后'"或"\"随后\"")
schtasks /Create /TN ITCMD-CHAT-NOTIF /SC ONLOGON /tr "'%cd%\Notif\Notif.vbs'" /F
Run Code Online (Sandbox Code Playgroud)
从schtasks文档中:
Run Code Online (Sandbox Code Playgroud)==> Spaces in file paths can be used by using two sets of quotes, one set for CMD.EXE and one for SchTasks.exe. The outer quotes for CMD need to be double quotes; the inner quotes can be single quotes or escaped double quotes: SCHTASKS /Create /tr "'c:\program files\internet explorer\iexplorer.exe' \"c:\log data\today.xml\"" ...
| 归档时间: |
|
| 查看次数: |
3396 次 |
| 最近记录: |