Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vbscript 如何在Windows任务计划程序中包含vbs代码?_Vbscript - Fatal编程技术网

Vbscript 如何在Windows任务计划程序中包含vbs代码?

Vbscript 如何在Windows任务计划程序中包含vbs代码?,vbscript,Vbscript,目前,我正在使用将vbs代码包含到Windows任务调度程序中。vbs这样的文件 <Actions Context="Author"> <Exec> <Command>cscript</Command> <Arguments>"c:\users\owner\desktop\test.vbs"</Arguments> </Exec> </Actions>

目前,我正在使用
vbs
代码包含到
Windows任务调度程序中。vbs
这样的文件

 <Actions Context="Author">
    <Exec>
      <Command>cscript</Command>
      <Arguments>"c:\users\owner\desktop\test.vbs"</Arguments>
    </Exec>
  </Actions>
但它没有起作用。
有没有办法将vbs直接写入命令行

cscript.exe
不是用来从输入或类似的东西接收代码的。脚本文件必须存在。
cscript.exe
&
wscript.exe
被设计为与任何其他.exe文件一样执行脚本(但您可以编写一个来执行)。顺便说一句,您不应该使用该用户路径安排脚本任务!
<Actions Context="Author">
    <Exec>
      <Command>cscript</Command>
      <Arguments>"msgbox ""hi"""</Arguments>
    </Exec>
  </Actions>