Computer Hope


Computer Hope Forum Welcome, Guest. Please login or register.
February 09, 2010, 06:56:14 AM
Home Help Staff Chat Login Register
News: Have your own custom built computer? Come join the self-built computer club.

Computer Hope - Computer Help Forums  >>  Microsoft  >>  Microsoft DOS (Moderator: Computer Hope Admin)  >>  Topic: 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 913 times)
neilw
Topic Starter
Starter
*
Posts: 3

Thanked: 0
OS: Windows XP
Experience: Familiar


« 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
Logged
neilw
Topic Starter
Starter
*
Posts: 3

Thanked: 0
OS: Windows XP
Experience: Familiar


« 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.
Logged
Dusty
Egghead
*
Posts: 3141

Thanked: 44
OS: Windows XP
Experience: Beginner



Country music Rocks.


« 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:
@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
Logged

Light travels faster than sound.  This is why some people appear bright until you hear them speak.
neilw
Topic Starter
Starter
*
Posts: 3

Thanked: 0
OS: Windows XP
Experience: Familiar


« 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!
Logged
Pages: [1] - (Top) Print 
Computer Hope - Computer Help Forums  >>  Microsoft  >>  Microsoft DOS (Moderator: Computer Hope Admin)  >>  Topic: Create folder from Volume name « previous next »
Jump to:  


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright 1998-2010 by Computer Hope (tm). All rights reserved
Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC
Page created in 2.074 seconds with 18 queries.