Task scheduler cannot open batch file when set to run whether user is logged on or not

前端 未结 7 1805
小蘑菇
小蘑菇 2020-12-24 07:46

OS: Windows Server 2008 R2 Enterprise

I am unable to get the Task Scheduler to run .bat files while I am logged off. I have a a production .bat file I want to use, b

7条回答
  •  盖世英雄少女心
    2020-12-24 08:00

    Not sure if this helps. My issue was using a interactive program (in particular Excel) as well.

    Creating the 2 empty folders (Desktop) solved it. Create both even if you are running on x64.

    C:\Windows\System32\config\systemprofile\Desktop
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    

    I debugged my code and realised the code exited at this line

    ExcelFile excelFile = new ExcelFile(directory, filename);
    

    I read this solution somewhere and I cannot find the URL now.

提交回复
热议问题