如果文件夹路径中有空格,如何运行无法执行的计划任务?

时间:2019-01-08 20:29:57

标签: cmd arguments parameter-passing scheduled-tasks taskscheduler

您好,谢谢您的帮助!

我正在通过Windows Server 2016 Standard上的任务计划程序将照片导入到应用程序中。问题是,当我添加参数时,如果我的路径中没有空格,则脚本不会执行。

我已经确认我的代码可以正确使用空格,并且将文件夹重命名为没有空格。如此有效:

source:folder folder:C:\ProfilePhotos\UserPhotos\ProfilePictures\ domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

但是,我需要保留文件夹中的空格。 (请注意用户照片和个人资料图片中的空格):

source:folder folder:C:\ProfilePhotos\User Photos\Profile Pictures\ domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

我尝试了以下添加单引号和双引号但无济于事的变化:

    source:folder "folder:C:\ProfilePhotos\User Photos\Profile Pictures\" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

source:folder 'folder:C:\ProfilePhotos\User Photos\Profile Pictures\' domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

source:folder folder:"C:\ProfilePhotos\User Photos\Profile Pictures\" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

source:folder folder:'C:\ProfilePhotos\User Photos\Profile Pictures\' domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

source:folder "'folder:C:\ProfilePhotos\User Photos\Profile Pictures\'" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

source:folder "folder:'C:\ProfilePhotos\User Photos\Profile Pictures\'" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

"source:folder folder:'C:\ProfilePhotos\User Photos\Profile Pictures\'" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

"source:folder folder:C:\ProfilePhotos\User Photos\Profile Pictures\" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

source:folder folder:"'C:\ProfilePhotos\User Photos\Profile Pictures\'" domain:HC nameType:profileproperty property:tkid crop:bottom pulseConnection:"Data Source=MyServerName01-DEV;Initial Catalog=Pulse;Integrated Security=True"

这是我的配置: https://i.imgur.com/ro9Lzlv.png 程序/脚本是可执行文件的路径。 参数包含有问题的路径。

如何在文件夹路径中使用空格运行参数?任何帮助将不胜感激。谢谢!! 〜亚当

0 个答案:

没有答案