[BATCH] Copy a file to multiple folders
AmonDiaC
-
Anonymous user -
Anonymous user -
Bonjour,
I want to create a batch script that copies a PDF and pastes it into all folders of a specified path.
I have this:
FOR /d %%i in (D:\Application Data\*.*) do @copy "D:\UnPDF.pdf" %%i
And it doesn't work because of the space in the path "Application Data". If I use "ApplicationData", it works. But I absolutely need it to work with a space since this is just an example for copying a config file into an App Data folder.
Configuration: Windows / Vivaldi 2.2.1388.37
I want to create a batch script that copies a PDF and pastes it into all folders of a specified path.
I have this:
FOR /d %%i in (D:\Application Data\*.*) do @copy "D:\UnPDF.pdf" %%i
And it doesn't work because of the space in the path "Application Data". If I use "ApplicationData", it works. But I absolutely need it to work with a space since this is just an example for copying a config file into an App Data folder.
Configuration: Windows / Vivaldi 2.2.1388.37
7 réponses
For your information, I have already tested with quotes « » = it does not work.
And I cannot do a « cd D:... » beforehand because I plan to manipulate \\domaine.lan\...
And I cannot do a « cd D:... » beforehand because I plan to manipulate \\domaine.lan\...
With this command, it correctly displays the directories contained in .\..\Application Data\*.
C:> for /D %a in ("..\..\Application Data\*.*") do @echo %a