Jump to content

Batch file, order of commands...


Chris
 Share

Recommended Posts

I made a batch file to copy my outlook.pst to a backup location, see below for more details. I was just wondering if after the Outlook.pst has been renamed to Outlook_old.pst I should have a wait, so that the copying of the Outlook.pst does not fail. However As I understand the way bacth files run, the next line won't start until the previous has finished correct? So once the rename has complete the copy will begin correct? :blink:

[code]@ECHO OFF
ECHO This will rename the Outlook.pst to Outlook_old.pst in the backup destination
ECHO (K:) as a fail safe if the following copy fails. Once the the file has been
ECHO renamed, the Outlook.pst (C:) will be copied to the backup destination.
ECHO When the file has been copied the Outlook_old.pst will be deleted.
ECHO.
ECHO.
ECHO 1) Outlook.pst will be renamed to Outlook_old.pst!
ECHO.
ECHO 2) Outlook.pst will then be copied!
ECHO.
ECHO 3) Outlook_old.pst will be deleted!
ECHO.
ECHO.
ECHO Outlook 2003 BACKUP BEGINS!
ECHO.
ECHO.
ECHO 1) RENAMING OF OUTLOOK.PST FILE!
ECHO.
ECHO Renaming Outlook.pst to Outlook_old.pst...
ren "K:\Application Settings\Outlook 2003\Outlook.pst" Outlook_old.pst
ECHO Rename Complete!
ECHO.
ECHO.
ECHO 2) COPYING OF OUTLOOK.PST FILE!
ECHO.
ECHO Copying Outlook.pst to K:\Application Settings\Outlook 2003\
copy /v "C:\Documents and Settings\Chris\Local Settings\Application Data\Microsoft\Outlook\Outlook.pst" "K:\Application Settings\Outlook 2003"
ECHO Copy Complete!
ECHO.
ECHO.
ECHO 3) DELETION OF OUTLOOK_OLD.PST!
ECHO.
ECHO Deleting Outlook_old.pst...
del "K:\Application Settings\Outlook 2003\Outlook_old.pst"
ECHO Delete Complete!
ECHO.
ECHO.
PAUSE
EXIT

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy