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 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

help with a batch file

  • 09-12-2005 2: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: 93,572 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