Running a scheduled task as SYSTEM with console window open
- by raoulsson
I am auto creating scheduled tasks with this line within a batch windows script:
schtasks /Create /RU SYSTEM /RP SYSTEM /TN startup-task-%%i /TR %SPEEDWAY_DIR%\%TARGET_DIR%%%i\%STARTUPFILE% /SC HOURLY /MO 1 /ST 17:%%i1:00
I wanted to avoid using specific user credentials and thus decided to use SYSTEM.
Now, when checking in the taskmanagers process list or, even better, directly with the
C:\> schtasks
command itself, all is working well, the tasks are running as intended.
However in this particular case I would like to have an open console window where I can see the log flying by.
I know I could use
C:\> tail -f thelogfile.log
if I installed e.g. cygwin (on all machines) or some proprietary tools like Baretail on Windows. But since I only switch to these machines in case of trouble, I would prefer to start the scheduled task in such a way that every user immediately sees the log.
Any chance?
Thanks!