Running a scheduled task as SYSTEM with console window open
Posted
by
raoulsson
on Server Fault
See other posts from Server Fault
or by raoulsson
Published on 2009-08-31T17:10:01Z
Indexed on
2012/06/29
3:18 UTC
Read the original article
Hit count: 485
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!
© Server Fault or respective owner