Re: Schedular just won't work

Tech-Archive recommends: Fix windows errors by optimizing your registry




"livetohike" <moormansd@xxxxxxxxx> wrote in message
news:26858e89-7ef7-43c2-bfeb-a325a96d0a74@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jun 3, 3:24 pm, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"livetohike" <moorma...@xxxxxxxxx> wrote in message

news:17b8183a-419e-4146-ad00-90b312fa4880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Thanks.
In the interest of clarity I had edited the batch I posted. Below is
the one I have been using and it runs w/ the anomaly described above.
Summary: Runs correctly from Explorer, but does not run from
scheduler.

Just in case I search the entire drive for the file w/ no luck.

echo %date% %time% %UserName% >> "C:\Documents and Settings
\Administrator\My Documents\Computers\Batch & Shortcuts
\ScheduleTest.txt"

I suggest you start nice and simple like so, then expand the
batch file one item at a time:
@echo off
echo %date% %time% %UserName% >> C:\Test.txt
echo Pausing for 30 seconds . . .
ping localhost -n 30 > nul
You must check the Task Scheduler's log file to see if
the task ran. And please don't wait another ten days with
your reply - this thread will have fallen off the edge of my
newsreader by then!

Great idea! Interesting results.

It worked as you wrote it. I then moved the bat into each of the
following folders and retested:
OK - C:\Documents and Settings\
OK - C:\Documents and Settings\Administrator\
OK - C:\Documents and Settings\Administrator\My Documents
OK - C:\Documents and Settings\Administrator\My Documents\Computers\
NO - C:\Documents and Settings\Administrator\My Documents\Computers
\Batch & Shortcuts\

I finally realized scheduler does not like the ampersand even though
the path is quoted... strange?

Easy enough to rename the folder, but I would like to now why '&' is
not supported by the schedular.
I tried 'escaping' it via && w/ no luck.

Thanks

Try escaping it like so: \Batch ^& Shortcuts\

About trouble-shooting: I don't claim any credit for having suggested
this approach. When attempting to solve a seemingly unsolveable
problem then it's standard practice
a) To break the problem into smaller and smaller pieces until
the cause becomes obvious, and
b) To simplify things as much as possible in order not to trip
over some issue that is hard to spot in complex code.
In the initial post in this thread you applied option b) (which
was a good thing) but you did it so savagely that it became
impossible for respondents to see the cause of the problem . . .


.



Relevant Pages

  • Re: Schedular just wont work
    ... In the interest of clarity I had edited the batch I posted. ... batch file one item at a time: ... following folders and retested: ... I finally realized scheduler does not like the ampersand even though ...
    (microsoft.public.windowsxp.general)
  • Re: Scheduled Task wont run unless use Admin account
    ... Posting the batch may also help. ... Remember that if it involves network resources to make sure the user account ... | I always get Could not start job in the task scheduler, ... | the target, and the directory in which it sits as the current directory ...
    (microsoft.public.windows.server.general)
  • Re: Running Batch files with Task Scheduler
    ... batch job' rights. ... | Task Scheduler runs the itemI get a result of 0x4 so the tasks never ... | computer A. If I run the batch file outside of task scheduler it runs ...
    (microsoft.public.win2000.general)
  • Re: W2k3 server Task Scheduler completed with an exit code of (1).
    ... > I'm trying to run a batch job from a remote ServerB from the task ... > scheduler on serverA. ... That account also has full control access to the ... > folder and batch file that is to be run. ...
    (microsoft.public.windows.server.general)
  • Re: A script to create for reboot
    ... workstation is in activity, the script must not start" part. ... In NT4, there is the AT command (that uses the Scheduler service, IE4 or later) but it can't do hourly scheduling, it can be used to schedule the batch file to run but you would have to enter 24 different "at" jobs to have it run at each hour. ... I would like to create a script to check every hour if a process is running. ...
    (microsoft.public.scripting.vbscript)