Windows 10 Scheduled Task only runs batch file if I am logged on

Page 2 of 3 FirstFirst 123 LastLast
  1.   My Computer


  2. Posts : 14
    Windows 10
    Thread Starter
       #12
      My Computer


  3. Posts : 831
    Windows 7
       #13

    OneDrive is OneDrive, whether you're on W10 or 11.
      My Computer


  4. Posts : 17,015
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #14

    ppowell777 said:
    I have Windows 10
    The full name of that tutorial in the TenForumsTutorial index is
    Set OneDrive Files On-Demand Status States in Windows 11 and Windows 10 - ElevenForumsTutorials
    Windows 11 is just a modified Windows 10. Many tutorials are the same for both.


    All the best,
    Denis



    Welcome to TenForums.

    It's really worth making time to browse through the Tutorial index - there's a shortcut to it at the top of every page.
    - At the foot of the Tutorial index is a shortcut to download it as a spreadsheet.
    - I download a new copy each month.
    - By downloading it as a spreadsheet I can benefit from Excel's excellent filtering capabilities when I search for topics of interest.
    - Tutorials are also listed by category at Tutorials - there's also a shortcut to that at the top of every page.
    - Both tutorial lists are searchable.
    - You can also search for TenForumsTutorials in many general search engines, such as Google, by adding site:tenforums.com/tutorials after your search term. For example,
    taskbar toolbars site:tenforums.com/tutorials

    You can search TenForums using the search box in the top-right corner of all TenForums webpages or using Advanced Search - TenForums
    - You can also search TenForums threads in many general search engines, such as Google, by adding site:tenforums.com after your search term. For example,
    Search for drivers by HardwareID site:tenforums.com
    - [This is what the search box in the top-right corner of TenForums webpages does automatically]
      My Computer


  5. Posts : 14
    Windows 10
    Thread Starter
       #15

    garlin said:
    OneDrive is OneDrive, whether you're on W10 or 11.
    Ok, so this is what I've done so far:

    1. Ensured that OneDrive copies to local files per settings
    2. Ensured that C:\Windows\System32\config, C:\Windows\System32\config\systemprofile, C:\Windows\SysWOW64\config, and C:\Windows\SysWOW64\config\systemprofile were accessible to all users per windows - Task Scheduler- Batch "Run whether user is logged on or not" not working - Super User
    3. Scheduled task to run at 1:45pm EST
    4. Left home to return at 2:30pm EST


    The scheduled task still refused to start, much less run. Nothing in the history. There were only 2 variables pertaining to Java that SYSTEM and myself have:

    Code:
    System.getProperty("JAVA_JDK_HOME") = C:\Program Files\Java\jdk14.0.1\bin
    System.getProperty("JAVA_CLASS_PATH") = C:\Users\phill\OneDrive\Desktop\classes
    I am out of ideas
      My Computer


  6. Posts : 831
    Windows 7
       #16

    I don't see any publicly available Java classes for DandyLabs, is that your employer/client's private code? Meaning no outsider can guess what the run-time requirements for this to work.

    Because you say it requires your logon presence, which is triggering some type of credential creation or caching.

    There's a mysql component, is the target database hosted locally or on another system? What makes this task require you specifically?
      My Computer


  7. Posts : 14
    Windows 10
    Thread Starter
       #17

    garlin said:
    I don't see any publicly available Java classes for DandyLabs, is that your employer/client's private code? Meaning no outsider can guess what the run-time requirements for this to work.

    Because you say it requires your logon presence, which is triggering some type of credential creation or caching.

    There's a mysql component, is the target database hosted locally or on another system? What makes this task require you specifically?
    The mysql component is on the same laptop as the Java classes: this laptop. Everything is here.

    There are public classes for DandyLabs, and they reside here, and myself ("phill") and SYSTEM should have equal access to it, however, again, if I am logged in, the task runs, but if I'm not, the task does not even start, much less run.. I can't imagine a scenario whereby an outside would need to know anything about the requirements for this class to run inasmuch as only "phill" and SYSTEM should know, as well as all other users on this laptop.
      My Computer


  8. Posts : 831
    Windows 7
       #18

    No, what I meant was since this is unpublished code -- we here can't see the inner workings. Everyone is treating the problem as a normal question on "Why doesn't my Scheduled Task work?"

    In your screenshots, Task History is enabled. I presume there should be a specific exit condition when the task runs, and upon error, some status or event code. That informs us whether the Task launch had a problem.

    If the Task was started, and returned no event error back to Windows; then the non-execution of the Java code has to be related to something that doesn't exist any more after you're logged out.
      My Computer


  9. Posts : 756
    Windows 10/11
       #19

    ppowell777 said:
    I don't understand. Do you mean to add "C:\Windows\System32" and "C:\Windows\SysWOW64" to the Java class path? I'm not sure what you mean
    I was thinking of the Java path (e.g. C:\Program Files (x86)\Common Files\Oracle\Java\java8path). However, that gets set in the System path by default, so that shouldn't be a problem.

    I installed Java and downloaded a simple command line tool (csv-2-xml.jar) and verified that I could run it successfully from the command line.

    The task worked fine once I changed "Java.exe" to the full path of "C:\Program Files (x86)\Common Files\Oracle\Java\java8path\java.exe". It even worked when set up to run as "NT AUTHORITY\SYSTEM".
      My Computer


  10. Posts : 14
    Windows 10
    Thread Starter
       #20

    LesFerch said:
    I was thinking of the Java path (e.g. C:\Program Files (x86)\Common Files\Oracle\Java\java8path). However, that gets set in the System path by default, so that shouldn't be a problem.

    I installed Java and downloaded a simple command line tool (csv-2-xml.jar) and verified that I could run it successfully from the command line.

    The task worked fine once I changed "Java.exe" to the full path of "C:\Program Files (x86)\Common Files\Oracle\Java\java8path\java.exe". It even worked when set up to run as "NT AUTHORITY\SYSTEM".
    I wound up adding an optional to the scheduled task:

    2>>C:\Tools\dandylabsblogentryretriever_err.log

    When I saved the task with this addition and allowed it to run while I was offline, this time it showed that it did run inasmuch as the error log was created, indicating that a required file in a "locked" directory in C:\users\\phill\\OneDrive\Desktop\\[hidden file]\\[locked file in the Control Panel]\DandyLabsBlogEntryRetriever.properties was not available to the scheduled task (was available in Java, batch script and cmd.exe, even run as TrustedInstaller)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:51.
Find Us




Windows 10 Forums