Jump to content

Win2k3 Batch file running with no errors but still not doing anything


Recommended Posts

Guest sailorfej
Posted

Hi folks,

 

I am having problems with a batch file running as a scheduled task, it

is a very basic batch file, that is supposed to rotate a generic

weekly back up file, and add the date to the file name, the contents

of the batch file are as follows:

********* Start rotate-weekly-backups.bat file contents

 

Set DD_MM_YYYY=%DATE:~4,2%_%DATE:~7,2%_%DATE:~10,4%

move e:\Shares\Backups\svr-sql\sql-weekly.bkf e:\Shares\Backups\svr-sql

\sql-weekly-%DD_MM_YYYY%.bkf

 

********** end rotate-weekly-backups.bat file contents

 

The command line in the scheduled task is as follows:

cmd /C E:\Shares\Backups\svr-sql\rotate-weekly-backups.bat

 

 

The batch file runs fine when run by double clicking or from the

command line and the backup file gets renamed, but when run from

within scheduled tasks it also reports that it ran successfully, and

does not generate any errors, but it does not rename the file.

 

Can anyone explain to me why this isn't working?

 

Thanks,

Jeff

  • Replies 1
  • Created
  • Last Reply

Popular Days

Guest sailorfej
Posted

Re: Win2k3 Batch file running with no errors but still not doinganything

 

Re: Win2k3 Batch file running with no errors but still not doinganything

 

On Apr 1, 11:47 am, sailorfej <j...@sailorfej.net> wrote:

> Hi folks,

>

> I am having problems with a batch file running as a scheduled task, it

> is a very basic batch file, that is supposed to rotate a generic

> weekly back up file, and add the date to the file name, the contents

> of the batch file are as follows:

> ********* Start rotate-weekly-backups.bat file contents

>

> Set DD_MM_YYYY=%DATE:~4,2%_%DATE:~7,2%_%DATE:~10,4%

> move e:\Shares\Backups\svr-sql\sql-weekly.bkf e:\Shares\Backups\svr-sql

> \sql-weekly-%DD_MM_YYYY%.bkf

>

> ********** end rotate-weekly-backups.bat file contents

>

> The command line in the scheduled task is as follows:

> cmd /C E:\Shares\Backups\svr-sql\rotate-weekly-backups.bat

>

> The batch file runs fine when run by double clicking or from the

> command line and the backup file gets renamed, but when run from

> within scheduled tasks it also reports that it ran successfully, and

> does not generate any errors, but it does not rename the file.

>

> Can anyone explain to me why this isn't working?

>

> Thanks,

> Jeff

 

A quick additional note it runs fine and renames the file when using

the AT command. Also I have tried both with and without the "cmd /C".

 

Thanks


×
×
  • Create New...