Announcement

Collapse
No announcement yet.

batch file wont work

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • batch file wont work

    Please help, this is my batch file that i have been working on. It works when i run it straight but when i run it with the scheduled task. it runs for about a second and thats it. i have researched it but cant seem to solve them problem. please help.


    Code:
    @echo off
     
    echo Backup PST and Fav
     
    echo.
     
    @For /F "tokens=1 delims=/ " %%A in ('Date /t') do @( 
     
    Set Today=%%A)
    REM Set DayForBackUp=Mon
     
    REM if not %Today% == %DayForBackUp% goto error
     
    :begin
    REM Xcopy /E \\70.182.8.81\Bridge-ts\"Documents and Settings and users"\micah\favorites\*.* f:\"bridge files"\staff\micah\Backups\ /Y 
    Xcopy /E t:\micah\favorites\*.* f:\"bridge files"\staff\micah\Backups\ /Y
    Xcopy /E t:\chris\favorites\*.* f:\"bridge files"\staff\chris\Backups\ /Y
    Xcopy /E t:\john\favorites\*.* f:\"bridge files"\staff\john\Backups\ /Y
    Xcopy /E t:\justin\favorites\*.* f:\"bridge files"\staff\justin\Backups\ /Y
    Xcopy /E t:\nicole\favorites\*.* f:\"bridge files"\staff\nicole\Backups\ /Y
    Xcopy /E t:\paul\favorites\*.* f:\"bridge files"\staff\paul\Backups\ /Y
    Xcopy /E t:\kathy\favorites\*.* f:\"bridge files"\staff\kathy\Backups\ /Y
    Xcopy /E t:\brian \favorites\*.* f:\"bridge files"\staff\brian\Backups\ /Y
    echo.
    echo Backing up Favorites Complete.
    echo.
    echo Please Wait while .PST file is backed up. This could take several minutes.
    echo.
    copy t:\micah\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\micah\Backups\ /y
    copy t:\chris\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\chris\Backups\ /y
    copy t:\john\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\john\Backups\ /y
    copy t:\justin\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\justin\Backups\ /y
    copy t:\nicole\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\nicole\Backups\ /y
    copy t:\paul\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\paul\Backups\ /y
    copy t:\kathy\"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\kathy\Backups\ /y 
    copy t:\brian \"Local Settings"\"Application Data"\microsoft\Outlook\outlook.pst f:\"bridge files"\staff\brian\Backups\ /y
    REM if not exist Outlook.pst goto error1
    echo.
    echo Backing up PST file Complete.
    echo Location: t:\micah\"Local Settings"\"Application Data"\microsoft\Outlook
    goto datetime
     
    :error1 
    echo !! ERROR !! Did not find PST file.
    goto datetime 
     
     
    :error
    echo !! ERROR !! %Today% is not the configured backup day.
    goto datetime
     
     
    :datetime
    date /t
    time /t
    echo.
    goto end
    :end
    Last edited by Rems; 3rd December 2008, 22:09.

  • #2
    Re: batch file wont work

    Post splitted!. from an old thread

    EDIT Post is also Double posted with,
    http://forums.petri.com/showthread.php?t=30637

    This thread is closed and scheduled for deletion.

    \Rems
    Last edited by Rems; 4th December 2008, 10:45.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment

    Working...
    X