The batch file is below. The vbscript is more complex, but it essentially
did the same thing.
To make this "simple", I have already tested a "simple" script that mapped a
network drive and dumped the directory listing into a log file - which ran
fine if I launched it, but it didn't run when scheduled.
Ok - let me try to paint this picture a little better: The batch file below
is scheduled to run...and it scheduled task is "executed" as evidenced by the
"Last Run Time" column. However, the code within the script doesn't execute.
The scheduled tasks doesn't report any error ("Last result" column = 0x0).
I have tried everything but rebooting the server. I have restarted the
scheduled task service, but it didn't change the results.
-Kevin
@echo off
rem This program will create Date Variables (%DD% %MM% %YYYY%)
rem and copy files to the backup server.
rem Reference:
http://www.fpschultze.de/smartfaq+faq.faqid+60.htm
Rem -----------------------------------------------------------------------
echo. | date | FIND "(mm" > NUL
if errorlevel 1 (call
arsedate DD MM) else (call
arsedate MM DD)
goto :EOF
arsedate ----------------------------------------------------------
rem for /f "tokens=1-4 delims=/.- " %%A in ('date /t') do (
for /f "tokens=1-4 delims=/ " %%A in ('date /t') do (
set Dow=%%A& set %1=%%B& set %2=%%C& set YYYY=%%D& goto :LogDate)
Rem -----------------------------------------------------------------------
:LogDate
Rem echo this for the log file
date /T
echo %YYYY%-%MM%-%DD%
goto :CopyFiles
Rem -----------------------------------------------------------------------
:CopyFiles
Rem Map the network drive, make the directories and copy the files
net use s: \\172.17.1.15\PACS_SQL_And_Server_Logs$ <PWXXXXX> /user:<IDXXXXX>
mkdir S:\Master-MSDBDB_Backup
mkdir S:\wisedb_backup
mkdir S:\WiseServerLogFiles
mkdir S:\WiseServerLogFiles\save-%YYYY%-%MM%-%DD%
xcopy H:\Master-MSDBDB_Backup S:\Master-MSDBDB_Backup /E /Y
xcopy H:\wisedb_backup S:\wisedb_backup /E /Y
xcopy C:\Progra~1\Philips\EasyAccess\log\saved
S:\WiseServerLogFiles\save-%YYYY%-%MM%-%DD% /E /Y
net use s: /del
Rem -----------------------------------------------------------------------
:EOF