Solved Xcopy strange behaviour? ** Solved **

Arnak

New Member
Messages
3
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
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
...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
Hi Bree,

Thanks for that advice, I'll remember that for netx time.:cool:)

Martin
 

My Computer

System One

  • OS
    Windows 8.1
    Computer type
    PC/Desktop
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/Pro/64
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Acer X-1200
    CPU
    AMD 2 Core
    Motherboard
    Acer
    Memory
    Crucial, 4GB
    Graphics Card(s)
    NVIDEA GeForce 9200
    Sound Card
    On Board
    Monitor(s) Displays
    24" Acer
    Hard Drives
    Sandisk, SSD 500GB
    PSU
    Acer
    Case
    SFF Slimline
    Keyboard
    emachines 101 key
    Mouse
    Logitech Wireless
    Internet Speed
    5 Meg
    Browser
    Firefox
    Antivirus
    Windows Defender
    Other Info
    Using Classic Shell on Win-8.1 /pro/64
Back
Top