Re: MS Scheduled Task



Locating the batch file on the network is not a good
idea - the task might not be able to access it because
of insufficient access rights.


"Wojo" <wojcik87@xxxxxxxxx> wrote in message
news:1164928515.047517.64470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pegasus,

I do get the following test.log after moving the bat file to my C
drive. As I mentioned earlier a test.log
is not created when the bat file is located on the network:

Thu 11/30/2006 17:11:24.58 Start of task
User=nbkr9hh,

Path=\\neon\binlib\dll\sql11.1.1\bin;\\neon\binlib\dll\sql11.1.1\dll;;C:\WIN
NT;C:\WINNT\System32;\\radon\binlib\dll\sql12\OCS-12_0\dll;\\radon\binlib\dl
l\sql12\OCS-12_0\bin;C:\WINNT\System32\Wbem;C:\Program
Files\Microsoft SQL Server\80\Tools\BINN;c:\lim\vbapi;c:\Program
Files\Rational\Common\;c:\Program Files\Common Files\Crystal
Decisions\2.5\bin\
Thu 11/30/2006 17:11:24.72 End of task


Wojo wrote:
Pegasus,

Here's my version of the bat file:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log

copy \\chiprddat\murexmxgro\xfer\MurexGFX_UserAccess.txt
"\\crprdndfs01\ds_dfs\GCIB Admin\TSISAuditExtracts\ADV"

copy \\chiprddat\murexmxgro\xfer\MurexGFX_GroupDesc.txt
"\\crprdndfs01\ds_dfs\GCIB Admin\TSISAuditExtracts\ADV"

echo %date% %time% End of task >> c:\test.log

A test.log does not get created when I run it via the scheduler. Here
are the contents of the log file when I run it manually:

Thu 11/30/2006 16:38:44.58 Start of task
User=nbkr9hh,

Path=C:\WINNT\System32;\\neon\binlib\dll\sql11.1.1\bin;\\neon\binlib\dll\sql
11.1.1\dll;;C:\WINNT;C:\WINNT\System32;\\radon\binlib\dll\sql12\OCS-12_0\dll
;\\radon\binlib\dll\sql12\OCS-12_0\bin;C:\WINNT\System32\Wbem;C:\Program
Files\Microsoft SQL Server\80\Tools\BINN;c:\lim\vbapi;c:\Program
Files\Rational\Common\;c:\Program Files\Common Files\Crystal
Decisions\2.5\bin\
Thu 11/30/2006 16:38:44.70 End of task

Pegasus (MVP) wrote:
Time to get serious. Modify your batch file like so:
@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
[put your own lines of code here]
echo %date% %time% End of task >> c:\test.log

Now do this:
1. Run the job manually.
2. Examine c:\test.log.
3. Schedule the job.
4. Examine c:\test.log.
5. Post your version of the batch file here.
6. Post the contents of c:\test.log here.


"Wojo" <wojcik87@xxxxxxxxx> wrote in message
news:1164901816.749910.82580@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pegasus,

I received the same result as before. When I run it manually it
works
fine, however,
when I run it via the scheduler the Command Prompt window opens then
closes before
running the bat file. I did include the server name in the Run field
this time around as follows but still no luck:

"\\chicago\doblib\Tech&Ops\Scheduled Tasks\Report
Output\MurexGFX.bat"

Pegasus (MVP) wrote:
"Wojo" <wojcik87@xxxxxxxxx> wrote in message
news:1164731157.300759.321950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm having a problem with MS Scheduled Task. I'm trying to run a
simple batch file via the scheduler but the DOS (Command Line)
window
opens then quickly closes without running the bat file. When I
run the
batch file manually it runs successfully. The batch file is a
simple
copy command and it is set up as follows:

copy \\chicago\murexmxgro\xfer\MurexGFX_UserAccess.txt
"\\newyork\ds_dfs\GCIB Admin\TSISAuditExtracts\MurexGFX"

I have the following set up in the Run field found in the
Scheduled
Task:

"P:\Tech&Ops\Scheduled Tasks\Report Output\MurexGFX.bat"

Not sure what I'm missing?


An often used alternative to inserting "pause" statements is to
run
the the batch file from a Command Prompt:
- Click Start / Run / cmd
- Type "P:\Tech&Ops\Scheduled Tasks\Report Output\MurexGFX.bat"

Note that mapped drives are often either visible under scheduled
tasks
or are inaccessible because of permission issues.




.



Relevant Pages

  • Re: Cant schedule a batch file to run in the XP Pro Scheduler
    ... Also look in Explorer and right-click the BAT file itself and check that all ... > a shortcut on the desktop or from the command window directly. ... > does NOT run fine is when I try to call the backup.bat batch file ... Why doesn't the XP task scheduler handle batch files? ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Task Scheduler Fails, But Not All the Time
    ... into the batch file below, ... echo %date% %time% Start of task> c:\test.log ... Now examine the two log files. ... In most Task Scheduler posts the ...
    (microsoft.public.windowsxp.general)
  • Re: task scheduler
    ... When I sent you a copy of the batch file i might have ... @echo offrem SCT Payment Client Startup for Banner Webrem AUDIT TRAIL: ... rem SCT Payment Client Startup for Banner Webrem AUDIT TRAIL: ... Task that run under the Task Scheduler are designed ...
    (microsoft.public.windowsxp.general)
  • Re: Task Scheduler Fails, But Not All the Time
    ... into the batch file below, ... echo %date% %time% Start of task> c:\test.log ... Now examine the two log files. ... In most Task Scheduler posts the ...
    (microsoft.public.windowsxp.general)
  • Re: Cant schedule a batch file to run in the XP Pro Scheduler
    ... If your backup program called in the BAT file is ... > does NOT run fine is when I try to call the backup.bat batch file ... Why doesn't the XP task scheduler handle batch files? ... > I want to automate the backup of our Retail Management Software ...
    (microsoft.public.windowsxp.perform_maintain)

Loading