问题描述
问题:当我双击它按预期执行.bat文件。当我在Windows任务计划安排它它执行除已CSCRIPT行了。
The problem: When I double click the .bat file it executes as expected. When I schedule it in Windows Task Scheduler it executes except the line that has cscript.
.bat文件内容:
@echo off
cls
cscript CSV_To_Excel.vbs c:\tableaudata\test.csv c:\tableaudata\test.xlsx
echo.file converted >>log.txt
什么是抛我了是log.txt中被创建,表明正在执行的.bat文件的事实。但.XLSX不会创建。然而,在手动双击.BAT的log.txt都和test.xlsx创建。
What is throwing me off is the fact that log.txt gets created indicating that the .bat file is being executed. But .xlsx is not created. However, on manually double clicking .bat both log.txt and test.xlsx is created.
这可能是什么问题?
推荐答案
解决!! 在Windows任务调度程序,我不得不请单击更改用户或组按钮,然后添加Administrators组。
Resolved!! In the windows task scheduler I had to click "change user or group" button and add "Administrators" group.
这篇关于如何执行CSCRIPT使用Windows任务调度程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!