Results 1 to 9 of 9

Thread: Using xcopy

  1. #1
    2 Star Lounger
    Join Date
    Aug 2014
    Posts
    123
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Using xcopy

    I have this setup for xcopy command:
    set source=C:\Users\winman\Desktop
    set dest=E:\Desktop
    The xcopy command looks like:
    xcopy %source% %dest% /E /T /V /Y

    It produces this error:
    Invalid drive specification
    and dies OR
    it finishes the copying within 1 minute and completes with NO errors AND NO ouput.
    Could someone offer and explanation?
    Is it because drive E has no directory created? I would like to think xcopy
    makes its own directory as needed.
    Last edited by spark55; 2015-12-09 at 06:44.

  2. #2
    WS Lounge VIP mrjimphelps's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    3,411
    Thanks
    447
    Thanked 406 Times in 378 Posts
    The only reason I can think of that you would get the results you are getting is because either (a) there's no C:\Users\winman\Desktop folder, or (b) there's no E:\Desktop folder.

    The command shouldn't be case-sensitive, but just to make sure, I would check to be sure that the case of the actual folder names matches the case of your environment variables.

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Spark,

    The /T switch copies directory structure but does not copy files.

    Type: XCopy /? to get the help file for all the switches.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,199
    Thanks
    48
    Thanked 987 Times in 917 Posts
    Or just use Robocopy, 'cause it's better!

    cheers, Paul

  5. #5
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    +1 RoboCopy!
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  6. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    +n also for Robocopy - one you understand how it works!

    Unlike in Unix, file names in Windows are NOT case sensitive.
    BATcher

    Time prevents everything happening all at once...

  7. #7
    WS Lounge VIP mrjimphelps's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    3,411
    Thanks
    447
    Thanked 406 Times in 378 Posts
    Quote Originally Posted by BATcher View Post
    Unlike in Unix, file names in Windows are NOT case sensitive.
    I didn't think they were case-sensitive, but that was all I could think of.

  8. #8

  9. #9
    Bronze Lounger DrWho's Avatar
    Join Date
    Dec 2009
    Location
    Central Florida
    Posts
    1,501
    Thanks
    30
    Thanked 205 Times in 163 Posts
    I've been using XCOPY since the DOS days, to copy or backup files.
    It's amazing how it still works, even under the latest OS's.

    One of the neatest things about it, is that's it's available for FREE, in every OS from DOS to Windows 10.

    I use it almost every day, in a batch file, to back up all my data files to external drives.

    For instance, this line backs up everything under C:\My Documents to an external USB HD.

    xcopy "C:\Documents and Settings\Alexi\My Documents\*.*" "N:\My Documents\" /S /Y /H /R /D

    Where, "N" is the designation for my external 1TB hard drive.
    The first time the batch file is run, it backs up every file and subdirectory under My Documents, on my C: drive.
    But, on subsequent runs, it only backs up new files and files that have been updated or modified.
    So my daily backups only take a few seconds.

    Sometimes, it appears that some folks try to make using XCOPY a lot harder than it really was ever meant to be.

    Happy New Year Everyone!
    The Doctor
    Last edited by DrWho; 2015-12-27 at 14:50.
    Experience is truly the best teacher.

    Backup! Backup! Backup! GHOST Rocks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •