PDA

View Full Version : Batch File



jwil1
22-11-2007, 09:25 PM
Hi all

I am trying to use MS's generic CD-ROM driver to make a CD drive accessible by MS-DOS.

I am using the batch file as follows:

@echo off
echo This is the installation program to enable CD-ROM access
echo for MS-DOS and early versions of Windows.
echo.
echo Files will be extracted from this floppy - you need to update
echo the AUTOEXEC.BAT file manually.
echo.
echo To do this:
echo Type the following after the last line:
echo.
echo C:\CDROM\MSCDEX.EXE /D:MSCD001
echo.
echo Restart your computer, and the CD-ROM drive in your computer
echo be active.
echo.
echo When ready,
pause

xcopy a:\*.* c:\CDROM\
end

Is there a way to automate the entering of the C:\CDROM\MSCDEX.EXE /D:MSCD001 text in the autoexec.bat file from within this batch file? (ie have my batch generate an extra line in the autoexec.bat containing that line of text?)

Also need to add a line to config.sys.

All help much appreciated.

CYaBro
22-11-2007, 10:30 PM
What exactly are you trying to do?

To load a DOS driver for a cdrom drive you need the driver file (from memory this will be a .sys file) loaded from the config.sys file.
Then you also need the mscdex line in the autoexec.bat file or you could load it from any other batch file or manually at the command prompt.

The .sys driver line has to be in the config.sys file.

Sweep
23-11-2007, 05:45 AM
You need to edit autoexec.bat and config.sys.

http://www.onecomputerguy.com/install/floppies.htm#sample

jwil1
23-11-2007, 08:02 AM
You need to edit autoexec.bat and config.sys.

http://www.onecomputerguy.com/install/floppies.htm#sample

Yes that's right, but I want a batch file to automate this for me.

Speedy Gonzales
23-11-2007, 10:28 AM
It depends on HOW you're going to boot into DOS.

I use my USB flash drive to boot into DOS.

And I can access a cd, which is R.

All, I did was format it, with its program, and download a copy of the 98 files from Bootdisk (http://www.bootdisk.com)

The only files on it are:

autoexec - with these commands in it

@echo off

MSCDEX.EXE /D:banana /L:R

And the DOS commands, that were in the zipped 98 file.

And if you want to do it from XP, I dont think you can.

It doesnt use Autoexec or config.sys.

Graham L
23-11-2007, 11:05 AM
echo C:\CDROM\MSCDEX.EXE /D:MSCD001 >> c:\autoexec.bat will add that line at the end of autoexec.bat. :cool: The double ">" redirection operator means append (at the end) of the existing file. A single ">" would make a new autoexec.bat, deleting the original, with only that line. (You may have discovered this. :( ;) ) I think the append might fail if there isn't a target file. There are ways around this.

jwil1
23-11-2007, 11:10 AM
echo C:\CDROM\MSCDEX.EXE /D:MSCD001 >> c:\autoexec.bat will add that line at the end of autoexec.bat. :cool: The double ">" redirection operator means append (at the end) of the existing file. A single ">" would make a new autoexec.bat, deleting the original, with only that line. (You may have discovered this. :( ;) ) I think the append might fail if there isn't a target file. There are ways around this.

I trust this will also work for config.sys also...

Graham L
23-11-2007, 11:18 AM
Yes .. just say "echo blah blah >> config.sys"

jwil1
23-11-2007, 11:23 AM
echo C:\CDROM\MSCDEX.EXE /D:MSCD001 >> c:\autoexec.bat will add that line at the end of autoexec.bat. :cool: The double ">" redirection operator means append (at the end) of the existing file. A single ">" would make a new autoexec.bat, deleting the original, with only that line. (You may have discovered this. :( ;) ) I think the append might fail if there isn't a target file. There are ways around this.

Thanks everyone - everything worked as expected.

Much appreciated :cool: