Barry Dilka wrote:
> 1) \\computername\username,
The prepended slashes ("\\") should be removed when entering the computer
and account for the Run As parameter's value when using the Task Scheduler
GUI. Just use "<computername>\<username>"
schtasks has its own separate /S parameter to specify the computer's name,
so don't prepend "\\" there, either. Use "/S <computername> /U <username>"
(omit the /S parameter if you are creating the task on your own host).
The "\\" before <computername> is only added when using the at.exe command-
line program.
> 2) The task never runs. Actually (depending on the task) it may or may not
> show up in the Task Manager, but not interactively. Notepad for example is
> displayed in TM, but that's it,
I forgot to check your prior posts. Did you check the scheduler service
("Task Scheduler") is defined, set to Automatic startup mode, and is current
in a running state?
- Run: services.msc (must be logged under an admin-level account)
- Look for the "Task Scheduler" service.
- Check the service is currently running (started).
- Check the service is configured for Automatic startup.
- Check the service starts under the "Local System" (SYSTEM) account, not
under a specific account (which may not even exist anymore).
o Here is the option "Allow service to interact with desktop" that Pegasus
might've referred to. I've never had this option enabled yet I've been
able to create scheduled tasks and see them run (if they open a window
although some programs don't need a console to run or only use a tray
icon).
- Under the Log On tab, check this service enabled for all hardware profiles
listed (or, at least, the hardware profiles where you want it active).
For example, you could define normal and game hardware profiles where the
game profile doesn't enable many services that aren't needed when you boot
and select the game profile. This eliminates conflicts, problems, and
unnecessary resource consumption when playing a game if you use a hardware
profile and select it during bootup of Windows.
> 3) No errors in the log (neither of them),
Expected if the job never executes that is being monitored by Task
Scheduler. So it looks like the task never does get executed. If you add
the task using the GUI for Task Scheduler, do you see the job show up in
that GUI? If so, right-click and select Run. Do you see that program's
window now even if only for a short time if the program runs quickly? Does
that program actually run without error? If it errors, like not even
loading, then there won't be a window but you should see a log entry
accounting for the failure. Will the program run from Start -> Run? If is
is a console-mode program, open a command shell (cmd.exe) and run the
command string to make sure what you think should run actually will run.
> 4) Nothing shows up on the task bar - assuming a task runs. So for example,
> in the command script that I tried earlier, I have several observations: a)
> The task shows up in the GUI Task schedular (not at the command prompt with
> "AT") After the scheduled time, the event remains in the GUI display,
'at' tasks do not automatically cleanup after themself even when scheduled
to run just once. Even the jobs you define in the GUI for Task Scheduler
will not disappear when scheduled to run only once. You have to enable the
option "Delete the task if not scheduled to run again" to have it disappear
after it ran its one time.
You say an 'at' defined job is showing up in the Task Scheduler's GUI. So
it does look like it is getting defined. You say the job doesn't run at its
scheduled time. Are you sure that you are using 24-hour military time when
specifying the start time? There is no AM/PM paramter to the 'at' or
'schtask' programs. If you want the job to run at 5:17PM then you have to
enter "17:17" for the time value. When using the GUI to Task Scheduler, you
are shown times with AM/PM affixes to ensure you are picking the correct
time, but 'at' and 'schtask' require 24-hour format. 'schtasks /create /?'
at least warns you about that for its /ST parameter but help for 'at' is
very terse.
> 5) If I right-click the task and select run, nothing happens at all,
Which leads me to believe that either you don't have permissions to run the
program specified in the Run field or you have an invalid program filename
or the parameters to that program are invalid.
In the GUI for Task Scheduler, look at the properties for the job you say is
there. Copy the Run field's value. Open a command shell (cmd.exe). Paste
the command string to ensure you are running exactly the same entire command
string (program and parameters). Don't hand copy the value of the Run
field. Copy and paste so you have an exact copy of the entire string. Does
it run from the command shell?
If it doesn't run from the command shell, the problem isn't with Task
Scheduler at all and simplifies to why you cannot run that command. It
could be something as simply as you forgeting to enclose strings within
double-quotes that contain spaces.
C
Program Files\Internet Explorer\iexplore.exe -nohome
is not a valid command string because of the spaces embedded in the path to
the executable file (and the executable file could also have spaces).
Parsing would end at "C
Program" but no such file "Program" (with no
extension, too) would be found under "C
". The proper command would be:
"C
Program Files\Internet Explorer\iexplorer.exe" -nohome