Thread: [REL] FOTRS Ultimate Project
View Single Post
Old 09-18-16, 05:11 PM   #1974
Jeff-Groves
Village Idiot
 
Jeff-Groves's Avatar
 
Join Date: Sep 2014
Posts: 5,364
Downloads: 131
Uploads: 0


Default

Got a few quick lessons for copying/moving files and folders for ya.


Say I want to get all the ships from a list moved to a folder to work on them.
Now I'm not going to copy paste them!
Here's how I do it.

Copy the Sea folder and paste it to the C drive root.
Rename it to Movethis
Get your list of ships built into a text file which I name File-list.txt.

Copy the code below and name it Move-folders.bat
Place it and your file-list.txt file in the Movethis folder
Run this batch file and be amazed!

Code:
@echo off
Setlocal EnableDelayedExpansion
set dir_list=File-list.txt
set dest_folder=c:\target
mkdir %dest_folder%
for /f "delims=" %%a IN (%dir_list%) do (
   set dir=%%a
   if "!dir:~-1!"=="\" set dir=!dir:~0,-1!
   move "!dir!" "%dest_folder%\"
)
The move Units will be in a folder called target on the C root
Delete all the files left in the Movethis folder as they are not what you want anyway.

Next is how to move say just Mission files on a list.

Last edited by Jeff-Groves; 09-18-16 at 05:23 PM.
Jeff-Groves is offline   Reply With Quote