Jump to content

copying multiple files


Bassman

Recommended Posts

I have purchased some add on Australian scenery which has numerous folders with airfield name, in each of which there is a scenery folder containing the relevant .bgl files. I know how to copy single files however is there a way I can use MSDOS (or any other program) where I can copy all the .bgl files in one step? i.e. four airfield name folders with one scenery file in each so I can copy the four .bgl's into one scenery folder in one step,  Hopefully I have not got you all as confused as I am.

Cheers Dan

Link to comment
Share on other sites

At the top of the folder, there is a tab that says "Organize". On the drop down menu click "Select All ". Copy and paste the lot.

 Or select one, hold down control as you select the next ones, copy etc.

Link to comment
Share on other sites

Thankyou Penzoil3. I think I have confused the issue. I will try and explain.

 

I have a folder named SAScenery which contains a folder named Aldinga OBX which contains a folder named scenery which contains three .bgl files. (eg xxx1.bgl, xxx2.bgl and xxx3.bgl)

I have a folder named SAScenery which contains a folder named Amata which contains a folder named scenery which contains four .bgl files. (eg xxx4.bgl etc etc etc )

I have a folder named SAScenery which contains a folder named American River which contains a folder named scenery which contains three .bgl files.( eg xxx8.bgl etc etc)

I want to copy all 10 .bgl files to a parent folder in one step. I cannot select all .bgl's as they are in different folders.

I was hoping that I could use MSDOS and create a batch file to do this however I keep running into syntax errors (years since I used MSDOS).

Any ideas? Cheers Dan

Link to comment
Share on other sites

What is wrong with simply moving them file by file or group by group manually? I would think it would take as long, if not longer, to write the batch file as it would to move them manually.

 

Have you tried Google? I checked it out and there are a multitude of options including a Youtube demo.

Link to comment
Share on other sites

Thanks Penzoil and Chumley. The problem with the simple method is that there are over 200 files to be moved and I am lazy and was hoping to use wildcards. Anyway I do appreciate your responses. Cheers Dan

Link to comment
Share on other sites

This can be done in four simple steps by opening two instances of Windows Explorer. In the first instance highlight all the files you want from the first scenery folder.

In the second instance move to the parent folder of your choice. Now just drag the highlighted files from the first instance to the second. Repeat this for the other three scenery folders. This is assuming there is only four folders to deal with as that is all you mentioned. There may be a problem in moving the .bgl files to one parent folder if there are duplicate file names. I hope this helps.

Link to comment
Share on other sites

Thanks antonvs,  as all the .bgl files are in individual folders and as there are over 200 folders your suggestion whilst appreciated will not work. I will just have to go the long way and move the .bgl files individually.

Cheers  Dan

Link to comment
Share on other sites

For a while now I have put all add-on scenery other than orbx into the addon scenery texture and scenery folders.  Doesn't affect loading or performance as far as I can tell.  Means I don't have a whole heap of scenery entries in the addon folder that have to be activated.

 

Link to comment
Share on other sites

Hi

 

Maybe the following will be helpful. I use it often to do what you asked. Just remember when you create the batch file with notepad. that by default notepad will save as a text file with the .txt extension. For an executable batch file, type the batch file name with the .bat extension and then change file type to all files. If you are making changes, just use save, not "save as" -- I once spent over an hour trying to understand why my batch file that did work stopped working :(

 

Cheers

Renault

 

************************************************************************************************************************************************************************************************

 

:: The following copies only the .png files in multiple subfolders from the folder  "E:Storage/To be copied"  to the folder E:Storage/Copied Files
:: Create this file in notepad (etc) and save as a .bat file
:: In this example I saved the batch file to my desktop and run it from there


set dSource=E:\Storage\To be copied
set dTarget=E:\Storage\Copied Files
set fType=*.png
for /f "delims=" %%f in ('dir /a-d /b /s "%dSource%\%fType%"') do (
    copy /V "%%f" "%dTarget%\" 2>nul
)
 

Link to comment
Share on other sites

Just a minor add to the above. Sometimes you want to copy a particular file type from multiple subfolders into a new folder and also retain the source folder file name with the copied file.  The following batch file will do this.

 

Best regards

Renault

 

**************************************************************************************************************************************************************************************

 

:: The following copies only the .png files in multiple subfolders from the folder  "E:Storage/To be copied"  to the folder E:Storage/Copied Files
:: Create this file in notepad (etc) and save as a .bat file
:: The structure below assumes that the batch file is on the desktop

@echo off
setlocal enabledelayedexpansion

set dSource=E:\Storage\To be copied
set dTarget=E:\Storage\Copied Files
set fType= *.png
for /R "%dSource%" %%F IN (%fType%) do (
    if exist "%%F" (
        set FILE_DIR=%%~dpF
        set FILE_INTERMEDIATE_DIR=!FILE_DIR:%dSource%=!
        xcopy /E /I /Y "%%F" "%dTarget%!FILE_INTERMEDIATE_DIR!"
    )
)
 

Link to comment
Share on other sites

I see what you're after here but it reminds me in some ways of working on a car... you'll get a nut or bolt that is in a confined space so it's going to take 5 full minutes to unscrew it infrustrating small increments, having to remove and replace the spanner on the hex head for each 1/6 turn.  So you figure... I'll go and get the socket set and it'll be a breeze.  So you get the socket set and first thing is the straight extension doesn't fit so you need the universal joint fitting.but it's not in its slot in the socket set.  You know it's somewhere in the toolkit so you go looking.  Eventually after more than 5 minutes you find it, you go back, fit the sockets together and before you know it, the nut is in your hands.  

 

Only problem is, it's been 10 minutes since you gave up the tried and trusted dependable spanner, that may have seemed to be less efficient, but you're 5 minutes behind where you would have been if you persevered with the apparently slower but laborious method.

 

Not saying the scenario applies here but it's something to keep in mind when looking for apparent shortcuts.^_^

Link to comment
Share on other sites

Provided I understand you correctly, the easiest way is:

Use the search function (the input field with the magnifier) in windows explorer to search for all files with the .bgl extension in the SAScenery folder, This will give you a list of all .bgl files in the  SAScenery folder and its sub folders. From this list you then can just copy/paste all the bgl-files needed at once.

Hope this helps!

Link to comment
Share on other sites

I like Wolfgang's suggestion - it is easy. Hadn't ever tried that -- thanks , I've learned a useful technique!

 

I  believe batch files are helpful and once you have written one they are very efficient if one has a need to undertake an operation multiple times. I understand John's concern if you have to start each time from ground zero, or if you are only ever going to do something once.  Sometimes that is not the case and that is perhaps then an argument for efficiency.

 

Bottom line is that there are many, many ways to skin a cat and one should always strive for the most reliable and easiest to implement approach commensurate with one's skill level and understanding of the problem.

 

Best regards

Renault

Link to comment
Share on other sites

5 hours ago, renault said:

.........

 

Bottom line is that there are many, many ways to skin a cat and one should always strive for the most reliable and easiest to implement approach commensurate with one's skill level and understanding of the problem.

 

Best regards

Renault

The KISS rule - Keep It Simple Stupid.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...