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
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 said:
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:
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.