Вопросы с меткой xcopy

I used * like in linux, that doesn’t work in PS

KenS's user avatar

3 gold badges37 silver badges56 bronze badges

Scott Bowden's user avatar

Use Get-ChildItem to loop over all the directories. You can do this in a one-liner.

Get-ChildItem -Path "C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\*\MQL4\Experts\" -Directory | ForEach-Object { Copy-Item -Path "C:\Users\Administrator\Desktop\EA\MT4\EA_bot.ex4" -Destination $_.FullName }

Martin Iszac's user avatar

I actually took this further, which might help others. This copies all *.ex4 or all *.ex5 files to ALL instances of MT4 or MT5 at one time with two commands. It copies from my local computer to the VPS servers; I just save the files to MT4 or MT5 locally. I changed the paths just for the fun of it; don’t use your desktop, as Microsoft syncs that to their cloud, and it just makes stuff run slow.

Get-ChildItem -Path "C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\*\MQL4\Experts" -Directory | ForEach-Object { Copy-Item -Path "\\tsclient\C\NOTYOURDESKTOPMICROSOFT\MT4\*.ex4" -Destination $_.FullName }
Get-ChildItem -Path "C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\*\MQL5\Experts" -Directory | ForEach-Object { Copy-Item -Path "\\tsclient\C\NOTYOURDESKTOPMICROSOFT\MT5\*.ex5" -Destination $_.FullName }

enter image description here

Jeremy Caney's user avatar

91 gold badges54 silver badges81 bronze badges

Scott Bowden's user avatar

Questions tagged [xcopy]

xcopy is a Windows command to copy all files, directories, and subdirectories from a specified path to a target directory

Is there a way to use xcopy, robocopy or batch, to copy and sort files

Dion Christensen's user avatar

save xcopy error message in a variable in powershell

likeeatingpizza's user avatar

Not Sure How to Proceed

Keith Howard's user avatar

In Windows copy a set of empty folders to a large number of differently-named subfolders

PJM's user avatar

Default sort order of xcopy

:/>  Прототип Figma: как самостоятельно сделать кликабельный прототип

Siyahi's user avatar

Can’t copy folder with permissions to NAS share

Eleandro's user avatar

Invalid number of parameters xcopy

user1015388's user avatar

XCopy specific txt files in multiple subfolders without subfolder in path

mashimena's user avatar

How to batch copy a list of folders and its file contents from a text file into a new folder in windows

MagicGnome's user avatar

why does the list switch allow xcopy to work?

mathlete's user avatar

Batch File Unable To Compare Two String Variables

MKEmike43ver's user avatar

using for loop to copy selected files in directory and subdirectories to new directory with the same structure

toan bui's user avatar

How do I write a batch programe to copy a set of folders with same suffix and their files from a server to a client?

UIsa's user avatar

Batch File to copy files to new directory while renaming, skipping existing files, and without confirmation

agrarian's user avatar

Copy a file in Post Build of Eclipse/Truestudio

ConductedForce's user avatar