in reply to Re^2: PAR packaging and Windows scheduled tasks
in thread PAR packaging and Windows scheduled tasks

Maybe the real path you use contains whitespace and the link in the Task Scheduler does not contain the appropriate double quotes? But the same should apply to the .bat file, so I'm not really sure where/why the problem is there as well.

Does your PAR program expect to be able to write to STDOUT? It might be that Windows does not allocate a console for the program, but allocates one for cmd.exe, which your PAR program then inherits.

Replies are listed 'Best First'.
Re^4: PAR packaging and Windows scheduled tasks
by ice94 (Novice) on Jan 06, 2016 at 14:24 UTC
    OK, I think I definitely narrowed it down to a whitespace issue. Here is my diagnosis regarding the settings of the scheduled task:

    Install path: "C:\Program Files (x86)\my_app\"

    -no specified default start path: did not work
    -specified "C:\Program Files (x86)\my_app\" as the default start path: did not work

    Install path: "C:\temp\my_app\"

    -no specified default start path: did not work
    -specified "C:\temp\my_app\" as the default start path: worked

    Install path: "C:\dir with spaces\my_app\"

    -no specified default start path: did not work
    -specified "C:\dir with spaces\my_app\" as the default start path: did not work

    I am still confused as to why the given start path does not work if it contains whitespaces BUT is enclosed in double quotes...


    UPDATE:

    Install path: "C:\Program Files (x86)\my_app\"

    -no specified default start path: did not work
    -specified "C:\Program Files (x86)\my_app\" as the default start path: did not work
    -specified C:\Program Files (x86)\my_app\ (i.e. same as above but w/o the double quotes) as the default start path: worked
      Did your scheduled task have access to your temp folder?
      Do you start it with a Runas admin rights?

      Check the Event Viewer ;)