copy a file to a different folder each time

October 22, 2012 at 10:12:20
Specs: Windows 7

I have a file that needs to be copied into a new folder each time.

so I need to be able to change the destination folder each time.

copy "c:\Program Files (x86)\Black Isle\BGII - SoA\WORLDMAP.WMP" "C:\Program Files (x86)\Black Isle\BGII - SoA\MPSAVE\000000112-archer2"

this needs to change each time "000000112-archer2" to whatever the new save game folder is.

See More: copy a file to a different folder each time

Report •

October 22, 2012 at 17:36:14
I believe you need to be a little more specific in your objectives and/or your problem description. Do you just want to increment a number (000112 to 000113)? Is it always going to be "archer", or will that also change (depending on player maybe)? Mind-reading is not my forte, Lol! Come back with some further details...

Report •

October 23, 2012 at 22:40:14
No the folder name needs to change each time because the save game name changes a lot.

Its just 1 file that stays the same being cpoied into a folder that change its name according to whatever the save name was.

Report •

October 24, 2012 at 19:43:20
Then we need a source to provide the name of the save-name folder.

Report •

Related Solutions

October 27, 2012 at 07:23:24
confuse topic very low information. the folder must have the saved file name? if not here goes some code...

@echo off
title ==Home Made==
if exist %temp%\8fb.txt goto ab
echo ^1>%temp%\8fb.txt
set /p hgf=< %temp%\8fb.txt
set /a gfs=%hgf%+1
echo Press any key to copy the file to a new folder
md "C:\Program Files (x86)\Black Isle\BGII - SoA\MPSAVE\000000112-archer2SaveNumber%gfs%"
copy "c:\Program Files (x86)\Black Isle\BGII - SoA\WORLDMAP.WMP" "C:\Program Files (x86)\Black Isle\BGII - SoA\MPSAVE\000000112-archer2SaveNumber%gfs%"
echo File saved in folder "C:\Program Files (x86)\Black Isle\BGII - SoA\MPSAVE\000000112-archer2SaveNumber%gfs%"
goto ab

Rem The code just ended dont add this line

What this litle script does is: save that file in the folder that you want it will tell you the name of the new folder, and i add a litle text to the folder to simplify your life. The final result will be something like this


i didnt teste this, i just coded right now but i think that every thing is ok , any bug or malfunction report to me.

i think that i dont need to say to past this code in a txt and then save it as Aname.bat . save it as .bat and run.

If this is not what you need please come with more more information

Report •

October 27, 2012 at 15:05:18
for /f "delims=" %%a in ('dir /b/tc/ad/od "C:\Program Files (x86)\Black Isle\BGII - SoA\MPSAVE"') do set dir="C:\Program Files (x86)\Black Isle\BGII - SoA\MPSAVE\%%a"
copy "c:\Program Files (x86)\Black Isle\BGII - SoA\WORLDMAP.WMP" %dir%

How To Ask Questions The Smart Way

Report •

Ask Question