Home / Microsoft / Microsoft DOS / Create folder from Volume name
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Create folder from Volume name  (Read 1435 times)
neilw
Topic Starter
Starter



Posts: 3


« on: February 03, 2009, 03:38:37 PM »

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,
Neil
IP logged
neilw
Topic Starter
Starter



Posts: 3


« Reply #1 on: February 03, 2009, 04:06:55 PM »

I found a utility that will create the text files for the database so that part is covered.
IP logged
Dusty
Egghead



Thanked: 71
Posts: 3,377

Experience: Beginner
OS: Windows XP


I could if she would, but she won't so I don't.

« Reply #2 on: February 03, 2009, 11:51:15 PM »

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 luck
IP logged

One good deed is worth more than a year of good intentions.
neilw
Topic Starter
Starter



Posts: 3


« Reply #3 on: February 04, 2009, 08:36:15 AM »

I 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!
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / Create folder from Volume name « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.152 seconds with 20 queries.