1.

Solve : Batch scripts/Scheduled Tasks?

Answer»

I am running batch SCRIPTS using the Scheduled Tasks feature in XP Pro. When run in Cmd.exe the scripts output info to the screen but not when run in Sched Tasks. The scripts run to completion and create expected disk files but no screen output. Is it possible to output to the screen when using Sched Tasks please?

Edit: This post has been relocated here from the WINDOWS forum, not sure why because the problem lies with the Task Scheduler not with the batch scripts. When Cmd.exe or the Windows TOUR or any other program is opened from within Scheduled Tasks, Tasklist and Taskmanager show that they are running but no screen output.

Win XP Pro.

I need to know how to disable silent mode when a task is run from the Task Scheduler. Tasks run to completion but without necessary screen output.

ThanksHow do you know it's a task scheduler problem?

Are you running a batch script? If so does that batch script have any 'pause' s in it?

If the batch file is running to completion and not given any other instructions it will remain when run from cmd.exe but disappear when run from somewhere else. Try putting in a 'pause' after the information you want is outputted.

FBIf you don't mind, I've merged the two topics and moved this all to the Windows Section.If I remember correctly, there's a checkbox in the Scheduled Task called "Run only when logged on." That has to be enabled. Otherwise, the task will run as whatever user credentials are specified in the task. If that user is different than the user logged on, there will be no screen output. THANK you for your interest.

Quote from: Fireballs

How do you know it's a task scheduler problem?

Are you running a batch script? If so does that batch script have any 'pause' s in it?

I reckon it's not a scripting problem as other programs which normally show screen output do not do so when started from Task Scheduler. However, I've tried to run a script (Files.bat) which, although it doesn't have Pause commands in it does have Ping commands to create a short pause in execution. The attachments show programs running without screen output (Solitaire {sol.exe} and Pinball.exe).

Quote from: killerb255
the task will run as whatever user credentials are specified in the task. If that user is different than the user logged on, there will be no screen output.

I haven't yet found the checkbox "Run only when logged on" but will continue searching. There is just one user on the system (see Accounts attachment) so the chances of tasks running in another user are fairly slim.

Following is an extract from the Task scheduler log to show that the script Files.bat ran to completion but without screen output -

Quote
"Task Scheduler Service"
Started at 1/4/2009 10:43:52 AM
"Solitaire.job" (sol.exe)
Started 1/4/2009 10:43:53 AM
"Pinball.job" (PINBALL.EXE)
Started 1/4/2009 10:43:54 AM
"files.job" (files.bat)
Started 1/4/2009 10:43:54 AM
"Command Prompt.job" (cmd.exe)
Started 1/4/2009 10:43:55 AM
"files.job" (files.bat)
Finished 1/4/2009 10:44:03 AM
Result: The task completed with an exit code of (0).

Any more suggestions will be appreciated.

Thanks again

[attachment deleted by ADMIN]On the tasksched.jpg screenshot, right-click your Scheduled Task and left-click Properties. The check box should be there.


Discussion

No Comment Found