Solved

Windows Server 2008 - Batch File will not run in Task Scheduler

Posted on 2014-09-16
4
244 Views
Last Modified: 2014-09-24
Hello Experts Exchange
I have a batch file that I'm trying to run in Windows Server 2008 Task Scheduler, in Task Scheduler it report that the task run successfully, but the script should create a log file and no log file is created.

Here is the code I'm trying to run.
@echo off
setlocal

@REM *** START: Turns logging on ***
if "%~1" == "NOWLOGGING" goto NowLogging
    set SchedulesLogFile=%~n0.txt
    %0 "NOWLOGGING" > "%SchedulesLogFile%" 2>&1
    goto :EOF
:NowLogging
@REM *** END: Turns logging on ***


@rem Guts of batch file...
echo [%date% %time%] starting...
echo *** start of actual batch file...
...
echo *** end of actual batch file...
echo [%date% %time%] ending...

Open in new window


How do I resolve the problem?

Regards

SQLSearcher
0
Comment
Question by:SQLSearcher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Vishalnarse earned 500 total points
ID: 40325066
Hello,

Please refer the below link for the same.

http://social.technet.microsoft.com/Forums/windowsserver/en-US/d47d116e-10b9-44f0-9a30-7406c86c2fbe/scheduled-task-wont-run-bat-file?forum=winservermanager

Hope this help you if still the issue persist please let me know.

Thank you,
0
 

Author Comment

by:SQLSearcher
ID: 40325270
Hello Vishalnarse
I have managed to fix it but I now have it stopping on lines of code like this;

"\\fileserver\Graham Rock\T and A\Code\D7aBlue594.vbs"

Open in new window


Its a problem with the " on the line, Task Scheduler can not handle it and there a hot fix, but I can not find the hot fix for windows server 2008.

Are you able to help?

Regards

SQLSearcher
0
 
LVL 4

Expert Comment

by:Vishalnarse
ID: 40327832
I need some time to investigate this issue... I will find this and update.

Thank you.
0
 

Author Closing Comment

by:SQLSearcher
ID: 40341300
Thank you for your help.

It looks like I need to install SP2 to the operating system to resolve my second issue.  Awaiting a good time to do so.

Regards

SQLSearcher
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question