Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

help with a batch file

  • 09-12-2005 03:51PM
    #1
    Closed Accounts Posts: 1,691 ✭✭✭


    is anybody good at batch files?
    I'm trying to run something simple.
    Just copy all files of a particular type from 2 network drives onto to my pc.

    This is what i have:

    @ECHO OFF
    cls
    REM move tif files from Z:\network\projects to C:\bmp

    xcopy "z:\projects\*.bmp" "C:\BMP\*.bmp" /S /Y
    xcopy "S:\*.bmp" "C:\BMP\*.bmp" /S /Y


    But this doesn't work, it just fires and nothing gets copied.


Comments

  • Registered Users, Registered Users 2 Posts: 1,477 ✭✭✭azzeretti


    Two things to note.
    1) Can the batch file access these drives by the drive mapping names?
    2) Does the user have access to view/copy these files from the network share?

    Also, not sure you need to specify the destination file type.
    xcopy "z:\projects\*.bmp" "C:\BMP\" /S /Y
    xcopy "S:\*.bmp" "C:\BMP\" /S /Y

    The above SHOULD do - almost certain!


  • Registered Users, Registered Users 2 Posts: 19,396 ✭✭✭✭Karoma


    Essential:
    Check that the commands work manually first: check that you can actually access z: and s: !

    Improvments:
    The destination: "C:\BMP\*.bmp" is unnecesasry -> "C:\BMP\" would suffice.
    You should be checking that the directories and files exist (both source and destination)


  • Closed Accounts Posts: 1,691 ✭✭✭RedPlanet


    Yes i can access both those drives.
    I have full control, not just read-only access.
    There are loads of directories underneath, i presume the batch file will drill down into them.
    Also, i've tested this by placing a .bmp on S:\
    Also confirmed there are tons of bmp's on those drives.

    Unfortunately, the new and improved batch file still doesn't work.
    It just fires and fires and copies nothing.


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


    BTW: that batch file doesn't move it copies.

    REM till fixed @ECHO OFF
    REM - why ? cls
    REM move tif ( *.bmp ?? ) files from Z:\network\projects to C:\bmp

    xcopy Z:\projects\*.bmp C:\Bmp\*.* /S /C /D /Y

    also lookup ROBOCOPY (a microsoft utility) and RSYNC (linux util with versions ported to windows)


Advertisement