Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need help with a DOS Batch File. I have added my batch file to a Win98 Boot Floppy. The Batch file includes a Menu. One of the Menu Choices is for copying the WinXP I386 Folder etc. to a C:\I386, Folder. What commands do I need, that will call another Menu Batch File, if there in not a WinXP Install Cd in the Cd-Rom Drive?
Below are three non-working Examples of what I have tried: {NOTE # 1: The Cd-Rom Drive is set to R: from within the Autoexec.bat of the Win98 Boot Floppy}
{NOTE # 2: The Partition Letter for Winxp is E:\, but I am testing My Batch File on Partition C:\}...................
I have tried using R: at the beginning of the Batch File
and have tried it without using R:
then I added,if not exist R:\Winxpsp2 call NOCD.bat
if exist R:\Winxpsp2\I386 copy R:\Winxpsp2\I386 C:\I386if not exist R:\Winxpsp2\I386 call NOCD.bat
if exist R:\Winxpsp2\I386 copy R:\Winxpsp2\I386 C:\I386if "%1"=="error" call NOCD.bat
............................................
The message I receive is, "Not ready reading Drive R abort, retry, fail?Question number two:
One of the Menu Choices of My Batch File is Exit.
I have Win98 S.E. installed on Partation C:\ of the Hard Drive.
What commands do I use, that will close out the Batch File and start
Win98 S.E. without having to Reboot the Computer?Thanks,
J.C.

"I have tried using R: at the beginning of the Batch File
and have tried it without using R:
then I added,"If that means a line to change drive to R: it's always a bad idea to attempt to change to a drive which may not be ready. Amd it's usually unecessary.
I don't see anything wrong with this chunk:
"if not exist R:\Winxpsp2 call NOCD.bat
if exist R:\Winxpsp2\I386 copy R:\Winxpsp2\I386 C:\I386"or the following one.
To be a little pedantic, I would use "matching pairs" of if exist/ not
if exist x:\abc
if not exist x:\abcThat way, it's sure to be one or the other.
Assuming that does not help, you may want to precede the CALL with ECHO, so you can "see what it's doing."
example:
if exist x:\abc echo got it
if not exist x:\abc echo nopeBTW, I guess you have a line which creates c:\i386 before the COPY. I always use XCOPY:
xcopy r:\i386 c:\i386\
With the trailing backslash on the dest, it will create the dir for you. And xcopy is a better tool in any case.
HTH
=====================================
If at first you don't succeed, you're about average.M2

Thanks for the info.
Below are the commands that will accomplish the desired results for My Batch file:
if [%1]==[] goto :xcopy
if not [%1]==[] goto :nocd
echo.:xcopy
xcopy r:\i386 c:\i386\:nocd
call nocd.bat
..................
I cannot figure out why the lines of command listed below will not work:Using the commands listed below, with or without the Winxpsp2 cd in the r:\ drive, the Batch File to echos nope.
if exist r:\i386 echo got it
if not exist r:\i386 echo nope
..............
If I use the commands as listed below, with or without the Winxpsp2 cd in the
r:\ drive, the Batch File always calls the nocd.bat.
if exist r:\i386 xcopy r:\i386 c:\i386\
if not exist r:\i386 call nocd.bat
......................
If I use the command
xcopy r:\i386 c:\i386\
the Batch File will copy the r:\i386 to c:\i386
...................
If I use the lines below, with or without the cd in the cd-rom drive, the batch goes to :nocd and then it calls the nocd.batIf exist r:\i386 Goto :xcopy
if not exist r:\i386 goto :nocd:xcopy
xcopy r:\i386 c:\i386\:nocd
call nocd.bat.........................
If I use the line below, it will copy the r:\i386 to r:\i386If exist r:\i386 Goto :xcopy
:xcopy
xcopy r:\i386 c:\i386\
..............
also, If I use the command
xcopy r:\i386 c:\i386\
the Batch File will copy the r:\i386 to c:\i386{note: You asked about creating the c:\i386 folder......
When I posted my first help request, My Batch File did include the command "md c:\i386"}
..........................
Thanks, for your comments, suggestions and help.
J.C.

OPPS MY MISTAKE:
I posted wrong info.
I used My Batch File from within Windows and the commands listed below worked.
However when I booted the computer using the Win98 Boot Floppy the Batch File produced the following results.
1. With the Winxp cd in the cd-rom drive the r:\i386 was copied to c:\i386.
2. Without the Winxp cd in the cd-rom drive, the message "abort, retry, fail etc.", appeared. At that point everything stopped.
3. Also, If ir remove the below commands and add the lines that include, "if exist and if not exist, commands will not work.if [%1]==[] goto :xcopy
if not [%1]==[] goto :nocd
echo.:xcopy
xcopy r:\i386 c:\i386\:nocd
call nocd.bat
..........................
J.C.

I'm a bit befuddled.
The only thing I can suggest is, modify this:
if not exist d:\i386 echo no i386
if exist d:\i386 echo got itto this:
if not exist d:\i386\nul echo no i386
if exist d:\i386\nul echo got it
=====================================
If at first you don't succeed, you're about average.M2

Current standing:
When booting with a Win98 S.E.or Win ME Boot Floppy and then calling a Batch File with these lines of command, both, found and not found are echoed. Also, I have tried everything as suggested within the replies of my post, without success.
@echo off
if exist r:\i386 echo found
if not exist r:\i386 echo not found........................
If I use the line below, it displays the message not ready reading etc. abort etc..@echo off
if exist r:\i386 echo found.......................
This line displays the message not ready reading etc. abort etc..@echo off
if not exist r:\i386 echo not found........................................
This line does echoes the Dir files of r:\i386dir r:\i386
........................
This line reads and echos the contents of the r:\i386 Dir and it also echos not founddir r:\i386
if not exist r:\i386 echo not found
.......................
Mechanix2Go,
Thanks for any help and/or suggestions,
J.C.

"I have tried everything as suggested within the replies of my post, without success."
Does that mean you added nul?
=====================================
If at first you don't succeed, you're about average.M2

Yes, I tried everything.
example:
if not exist r:\i386\nul echo no i386
if exist r:\i386\nul echo got itit displayed the .....abort, retry, fail messgae.
...........
J.C.

I think there's a line which can be put into config or autoexec to cause it to "auto fail" if the drive is not ready. But I can't remember or find it.
Try this:
echo a|dir r:\i386
=====================================
If at first you don't succeed, you're about average.M2

With the Winxpsp2 cd in the Cd-rom Drive
the line "echo a|dir r:\i386", quickly reads, scrolls and dislpays the contents of
r:\i386. Using the line without the cd in the cd-drive it displays the ....abort, retry, fail message.
......................
Since the beginning of my trying to use My Batch File:
With the cd in Drive R:\,
If I use the line: {copy or} xcopy r:\i386 c:\i386, the command always runs and copies as it is suppose to.
................
With the Winxpsp2 cd in the R:\ drive:
A couple of times when using the lines below: {note or any other text to be echoed such as " echo DUMB COMPUTER FIND THE DARN THING"} It echoed not found. If I remove the line "if not exist..........." it displays the ....abort, retry, fail message.@echo off
if exist r:\i386\nul echo found
if not exist r:\i386\nul echo not found..................
J.C.

Hi J.C.,
I'm stumped.
Maybe try a post in DOS or w9x with a subject like: "ignore abort/retry/fail on empty drive"
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |