Solved

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

Posted on 2014-09-16
4
229 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
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Vishalnarse earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
I need some time to investigate this issue... I will find this and update.

Thank you.
0
 

Author Closing Comment

by:SQLSearcher
Comment Utility
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

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

I was asked if I could set up a fax machine so that incoming faxes were delivered to people's Exchange inboxes and so that they could send faxes from their desktops without needing to print the document first.  I knew it was possible but I had no id…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now