1.

Solve : Create folder from Volume name?

Answer»

I want to copy numerous CD's to a server. I want to place the files from each CD into a folder named after the CD Volume name.

There are about 4 cd's that have the same volume name so I would need to be warned about over writing a folder and have the option to modify the target folder name if there is a conflict. Since there are only a few of these I can manually handle it vs. trying to program it as long as the folders don't get over written by the batch file. Ideally I want to just opo in a CD and RUN the batch without having to babysit it, so prompting should only be when a decision must be made. All the folders will be in one main folder on the server.

I ALSO want to create a database for all the files that will contain the filenames, type (extension), last write date and folder location. I will be using Access. All I need are delimited text files with the needed fields that I can import into Access.

I used to work with DOS years ago and have made some simple batch files so that would be the easiest for me.

TIA,
NeilI found a utility that will create the text files for the database so that part is covered.Welcome to the CH forums.

The following script might do what you want, you will have to modify the drive letter for the cdrom and source and destination paths to suit your purpose. The script is totally untested...

Code: [Select]@echo off
cls

for /f "tokens=1-6" %%A in ('vol c:') do (
set vol=%%F & goto rumble
)

:rumble
if exist path\%vol% (
echo Destination folder %vol% already exists... & goto newname
) else (
md path\%vol%
copy "c:\*.*" "path\%vol%\"
)
cls
exit/b

:newname
set /p vol=Enter new name for destination folder:
goto rumble

Good luckI GOT your program to work Dusty. All it needed was a few minor tweaks, namely change the COPY command to XCOPY, take out the wildcards and add the /s parameter to XCOPY and put the quotes only around the destination path.

Thank you!



Discussion

No Comment Found