Score:0

Robocopy only copy *.vhdx files in root folder

mx flag

how can I copy with Robocopy only *.vhdx files in the root directory? It is important to me that the file attribute and secuirty is preserved.

I used

robocopy \\Server\Users ServerNew\Users /sec /mir /log:c:\logs\log.txt /v /tee /w:2 /r:0 /copy:DT

However, it keeps copying the subdirectories, which I don't want.

Thanks for your support

joeqwerty avatar
cv flag
You're using the /mir option, which appears to not be what you want. Have a look at the robocopy documentation. - https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
Score:0
ru flag

/mir implies /e (recurse including empty subdirs).

If you want to copy new(er) files and purge removed files in a single directory, just use the /purge option instead of /mir.

Score:0
cn flag

Use robocopy withour /mir, like this:

robocopy \\Server\Users \\New\Users /sec /log:c:\logs\log.txt /v /tee /w:2 /r:0 /copy:DT
Score:0
sm flag

i think the below would work, however you may want to test it, on some test files before you run it. Recommend trying on some dummy text files.... i'm mobile right now.

robocopy C:\Source C:\Destination *.vhdx /E /COPY:DATSOU /DCOPY:T /sec
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.