• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Xcopy strange behaviour? ** Solved **


Arnak

New Member
Posts
2
#1
I found the culprit, it was the /e copying all the subdirectories for some reason?

Hi,

I have a batch file to copy over some data for backup.

The following command is used xcopy "C:\program files (x86)\*.s3db" /e /v /I /y /h M:\Pams Backups\Money

The batch file creates the directory and copies over the 2 .s3db backup files as it should but then starts to copy over the rest of the program files directory, starting with Adobe!!!

Can you please explain why it is doing that and not stopping after the .s3db files?

Thanks,

Martin
 
Last edited:

My Computer

System One

  • OS
    Windows 8.1
    Computer type
    PC/Desktop
#2
If need be, run this batchfile over to sevenforums, there are some very good batchile kings in there.
"...starts to copy over the rest of the program files directory, starting with Adobe..."
I think you're saying that other stuff is being copied into the created directory, correct?
"...explain why it is doing that and not stopping after the .s3db files?"
I am not savvy about xcopy, however, the batchfile kings in sevenforums probably are very savvy about xcopy.
 

My Computer

System One

  • OS
    Windows 7 Pro 64bit [MS blue-disk set]
    Computer type
    PC/Desktop
    System Manufacturer/Model
    2 Acers & 1 Antec[?]
    CPU
    i7 in 2 Acers, i5 in desktop
    Motherboard
    Desktop w/Gigabyte
    Memory
    Two w/16GB, 1 w/8GB
    Graphics Card(s)
    Laptops GameWorthy; Desktop maybe GameWorthy
    Monitor(s) Displays
    flatscreens; 2 are BluRay worthy
    Screen Resolution
    1368x768; 1600x900
    Hard Drives
    1TB internals; 2 ext usb WD 1TB HDs
    PSU
    what's PSU?
    Cooling
    Regular plus external fans
    Keyboard
    desktio w/PS2
    Mouse
    desktop w/PS2
    Internet Speed
    DSL middle level [160?]
    Browser
    from Netscape 0.9 to FF 36
    Antivirus
    well-balanced, well-configured mult-layered defense is best
    Other Info
    From MS-DOS 3.3, MS-DOS 6.22, from Windows 3.1 to WFW 3.11 to Windows 95-98SE, now to Windows 7 Pro.
    Security for now: Windows 7 Firewall, Emsisoft AM, MSE [scan-only], SpywareBlaster, Ruiware/BillP combine

Bree

Member
VIP Member
Member
Posts
42
#3
...The batch file creates the directory and copies over the 2 .s3db backup files as it should but then starts to copy over the rest of the program files directory, starting with Adobe!!!

Can you please explain why it is doing that and not stopping after the .s3db files?
It's the /E option. This specifically tells XCopy to copy over all empty directories too. Your Adobe (et. al.) directory matches as a directory that is 'empty' because it contains no .s3db files, therefore an empty Adobe directory will be copied over.

/e
Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options.
Microsoft Docs | xcopy
 

My Computer

System One

  • OS
    8.1
    System Manufacturer/Model
    Hyper-V

TechnoMage

Active Member
Power User
Central Florida

Posts
394
#5
Unless one is a real Batchfile Guru, it's helpful to have a printed listing of all the XCOPY switches available while composing the batch file.
I also use batch files to back up all my data files (My Documents) to multiple external drives. My command line contains at least six switches, to make sure I get everything I want.
I use the " /s " switch a lot, but I can't remember ever using the " /e " switch. I don't know why I would.

Y'all have a great 2020 now, Y'hear?
:cool:
 

My Computer

System One

  • OS
    Win-8.1
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Gigabyte
    CPU
    AMD 8 Core
    Motherboard
    Gigabyte
    Memory
    PNY, 4GB
    Graphics Card(s)
    NVIDIA, GForce 210
    Monitor(s) Displays
    21" HP
    Hard Drives
    Seagate SATA III, 500GB
    PSU
    Antec Earthwatts, 650
    Case
    Pac-Man Case
    Keyboard
    HP Professional
    Mouse
    GearHead Wireless
    Internet Speed
    5 Meg
    Browser
    Firefox
    Antivirus
    AVG Free
    Other Info
    Using Classic Shell on Win-8.1 pro

Users Who Are Viewing This Thread (Users: 0, Guests: 1)