|
| 05 Jun 2013 11:13 AM |
I'm currently trying to make a batch file that basically copies folders and places them in another folder for my friends. The problem is, when I run it, it only copies the files. It doesn't copy the folders. How can I fix this?
@ echo off
echo This file will now install MultiMC.
pause
mkdir C:\MultiMC\
copy "C:\MULTIMC1\MultiMC\icons\" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\instances\" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\lang\" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\lwjgl\" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\mods\" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\multimc.cfg" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\MultiMC.exe" "C:\MultiMC"
echo MultiMC has been successfully installed.
echo MultiMC has been installed in C:\Program Files\
pause |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 11:31 AM |
| Try removing the \ after the folder names |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 11:38 AM |
I tweaked it a little. I got it to place the files in the right place, but how do I make it copy the folders inside the folders? It only copies the files inside the folders.
@ echo off
echo This file will now install MultiMC.
pause
mkdir C:\MultiMC\ mkdir C:\MultiMC\icons\ mkdir C:\MultiMC\instances\ mkdir C:\MultiMC\lang\ mkdir C:\MultiMC\lwjgl\ mkdir C:\MultiMC\mods\
copy "C:\MULTIMC1\MultiMC\icons" "C:\MultiMC\icons" copy "C:\MULTIMC1\MultiMC\instances" "C:\MultiMC\instances" copy "C:\MULTIMC1\MultiMC\lang" "C:\MultiMC\lang" copy "C:\MULTIMC1\MultiMC\lwjgl" "C:\MultiMC\lwjgl\" copy "C:\MULTIMC1\MultiMC\mods" "C:\MultiMC\mods\" copy "C:\MULTIMC1\MultiMC\multimc.cfg" "C:\MultiMC" copy "C:\MULTIMC1\MultiMC\MultiMC.exe" "C:\MultiMC"
echo MultiMC has been successfully installed.
echo MultiMC has been installed in C:\Program Files\
pause |
|
|
| Report Abuse |
|
|
| |
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 05 Jun 2013 12:44 PM |
| I would like to point out that batch is a shell language and not a scripting language, so you may want to go to stack overflow since they are better and more applicable. |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 05 Jun 2013 12:48 PM |
| According to the first entry on the first page on the first google result for the search "how to copy a folder with batch" xcopy folder1 folder2 /s /e |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 12:54 PM |
@MrChubbs
Ok, thanks. First time I looked it up and tried it out, it handed me an error. I found it that it was because of it wasn't run as an administrator. |
|
|
| Report Abuse |
|
|