Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Batch file to copy user docs from laptop to network share

  • 16-08-2007 2:48pm
    #1
    Registered Users, Registered Users 2 Posts: 10,272 ✭✭✭✭


    Hi,

    I've been asked to make a batch file to copy users docs and outlook psts to a network share.
    These are laptop users that come into the office about once a month.

    Below is one I've come up with this mornnig.
    It will search their user profile, the root of c: and a scan of d:

    Some of the users will not have a d partition.
    How can I get the script to check if there's a d drive on the laptop or to skip if there's just c:?

    ATM you get a prompt to "Ignore, retry, fail" when running the below on a 1 partition machine which I'd like to avoid.
    echo off
    cls
    echo *******************************************************************************
    echo * This script will copy the following file
    echo * types to to S:\File_Backup from your PC
    echo *
    echo *  - *.DOC - Word
    echo *  - *.XLS - Excel
    echo *  - *.PAB - Personal Address Book
    echo *  - *.PDF - Adobe PDF
    echo *  - *.PST - Outlook Archive
    echo *  - *.PPT - Power Point
    echo * 
    echo * Only source files that are newer than the destination files will be copied
    echo *******************************************************************************
    pause
    echo *
    echo >> c:\%username%_File_Backup_to_HomeDIR.txt
    date /t >> c:\%username%_File_Backup_to_HomeDIR.txt
    time /t >> c:\%username%_File_Backup_to_HomeDIR.txt
    
    echo Computer name : %computername% > c:\%username%_File_Backup_to_HomeDIR.txt
    echo *
    echo Copying Word docs
    echo *
    XCOPY c:\*.doc %HOMESHARE%\File_Backup\ /C /D /Y /I
    XCOPY d:\*.doc %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    XCOPY %userprofile%\*.doc %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    echo *
    echo Copying Excel files
    echo *
    XCOPY c:\*.xls %HOMESHARE%\File_Backup\ /C /D /Y /I
    XCOPY d:\*.xls %HOMESHARE%\File_Backup\ /C /S /D /Y /I /q
    XCOPY "%userprofile%"\*.xls %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    echo *
    echo *******************************************
    echo * Please close Outlook before you proceed *
    echo *******************************************
    pause
    echo Copying Personal Address Book
    echo *
    XCOPY c:\*.pab %HOMESHARE%\File_Backup\ /C /D /Y /I
    XCOPY d:\*.pab %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    XCOPY "%userprofile%"\*.pab %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    echo *
    echo Copying Outlook Archive
    echo *
    XCOPY c:\*.PST %HOMESHARE%\File_Backup\ /C /D /Y /I
    XCOPY d:\*.PST %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    XCOPY "%userprofile%"\*.PST %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    echo *
    echo Copying Adobe PDF files
    echo *
    XCOPY c:\*.pdf %HOMESHARE%\File_Backup\ /C /D /Y /I
    XCOPY d:\*.pdf %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    XCOPY "%userprofile%"\*.pdf %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    echo *
    echo Copying Power Point files
    echo *
    XCOPY c:\*.PPT %HOMESHARE%\File_Backup\ /C /D /Y /I
    XCOPY d:\*.PPT %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    XCOPY "%userprofile%"\*.PPT %HOMESHARE%\File_Backup\ /C /S /D /Y /I
    pause
    

    Cheers for reading


Comments

  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 92,407 Mod ✭✭✭✭Capt'n Midnight


    [php]if not exist D:\*.* goto :bottom
    xcopy d:
    :bottom[/php]


    also have a look at robo copy - it has more tweaks than xcopy , main one would be file size, and better behaved on a network


  • Registered Users, Registered Users 2 Posts: 10,272 ✭✭✭✭Standard Toaster


    I went for this in the end:
    dir D:
    
    if %errorlevel% EQU 1 goto Ddrive
    
    goto Cdrive
    
    :Ddrive
    
    
    XCOPY d:\*.doc %HOMESHARE%\File_Backup\
    

    Which works fine but I think your method is better.
    Cheers for that. I'll give robo copy a look tonight.


Advertisement