简体   繁体   English

按计划任务运行文件无法正常工作

[英]Running file as scheduled task is not working properly

I've written a script in c# which I have to execute on a daily basis. 我已经用C#编写了一个脚本,每天必须执行一次。 It's something like an updater for my data base. 就像我的数据库的更新程序一样。 So it pulls some data from the Active Directory using CSVDE, and saves that info into csv files in the same directory, then parses those files and updates my database if necessary. 因此,它使用CSVDE从Active Directory中提取了一些数据,并将该信息保存到同一目录中的csv文件中,然后解析这些文件并在必要时更新我的​​数据库。 Obviously I don't want to run it manually every day, so instead I added a scheduled task. 显然,我不想每天手动运行它,所以我添加了一个计划任务。 My problem is that it doesn't create the expected files, at least in the same path. 我的问题是,它至少在同一路径中无法创建预期的文件。 If I run the script manually it works like a charm. 如果我手动运行脚本,它会像一个超级按钮一样起作用。 Also after a scheduled run I tried to find those files by filename on the machine to check whether those were created in some other place, but no luck. 同样,在计划的运行之后,我尝试在计算机上按文件名查找那些文件,以检查这些文件是否在其他地方创建,但是没有运气。 Do you have any idea why it not works the same way? 您知道为什么它不能以相同的方式工作吗?

It was some issue with the credentials under the script ran. 脚本运行下的凭据有问题。 Solved now. 现在解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM