MSDOS Batch help

  Simon_P 00:17 24 Mar 03
Locked

I want to create a batch file that will copy all the files from C:\MONEY and C:\letters directorys onto a floppy disk and then list the contence of the floppy disk.

I know that this may seem a bit odd but I have an old 486 with DOS6.2 and 3.1 which has crashed and I can only get to the dos prompt.

Any help wili be greatly appriciated

Thanks in advance

  DieSse 01:46 24 Mar 03

Will they fit on a single floppy? -

Do you want them compressed or uncompressed (zipped)? -

Where do you want the listing - screen or printer?

Is there any special reason you want it as a batch file, or is this a once only exercise?

  Simon_P 03:21 24 Mar 03

Yes they will fit on floppy
Uncompressed
Listing on screen
main reason to learn and to practise DOS Batch commands

Thanks for your help

  Pesala 06:22 24 Mar 03

click here

There are plenty of other sources too. Just type "DOS Batch Files" into Google search to get a long list of possible sources.

  Simon_P 12:40 24 Mar 03

Unfortunatly, I cant see what I an looking for in the link provided.

Any more info Please

Thank you

  cherria 12:55 24 Mar 03

Assuming you are starting from a freshly formatted floppy, create a text file called whatever.bat with the following lines in it:

md a:\money
md a:\letters
copy c:\money\*.* a:\money
copy c:\letters\*.* a:\letters
dir a:\money
dir a:\letters

make sure you are in the directory with the new whatever.bat file in it and type whatever. Each of the commands will run in turn with output going to the screen.

If you already have \money and \letters created on the floppy drive, drop the first 2 lines

  cherria 12:56 24 Mar 03

Lets try that with some returns in it...

Assuming you are starting from a freshly formatted floppy, create a text file called whatever.bat with the following lines in it:

md a:\money

md a:\letters

copy c:\money\*.* a:\money

copy c:\letters\*.* a:\letters

dir a:\money

dir a:\letters

make sure you are in the directory with the new whatever.bat file in it and type whatever. Each of the commands will run in turn with output going to the screen.

If you already have \money and \letters created on the floppy drive, drop the first 2 lines

  Pesala 13:20 24 Mar 03

No arguments with the solution provided by Cherria, but a couple of refinements may be needed if this batch file was to be used regularly.

First, I would suggest instead of two directory commands, replace with:

dir a:\*.* /s | more

The \backslash avoids errors if the active directory on A: is not the root. The forward slash /s option lists all files in all subdirectories. The pipe | more command pauses the output when the screen is full.

If the batch file is run again when the directories already exist on A: it will generate errors. So preceded with If not exist statements:

If not exist a:\money md a:\money

If not exist a:\letters md a:\letters

If you want to learn from the experts, read the various tutorials available online. Some may be much better than the first link that I found from a Google Search.

  Pesala 13:25 24 Mar 03

If not exist directory doesn't seem to work. My knowledge is very rusty. A long time since I wrote any batch files.

  Simon_P 17:18 24 Mar 03

Thank you all for your help.

I am not too bad with dos but was not sure how to write the edit lines.

I think that this will answer my questions.

Going to try now and will add resolved if sucessful.

Thank you again

  Simon_P 18:24 24 Mar 03

Thank you cherria for your help and Pesala for your revisions.

Both versions done exactly what I wanted.

This is now resolved

:-)

This thread is now locked and can not be replied to.

What is Amazon Go and will it come to the UK? The store without checkouts or queues

1995-2015: How technology has changed the world in 20 years

Hands-on with the Star Wars fighting drones you can fly yourself

iPhone 9 and beyond: 32 amazing future smartphone developments - graphene, supercapacitor…