Jump to content

FINDCD.EXE


Recommended Posts

===========================

First we'll need to acquire the FINDCD.EXE program. All it does is replace those nasty IF EXIST lines in most code. It also gets rid of those problems when ZIP drives are used as an error may be caused by those IF EXIST lines. Download FINDCD.EXE here.

Now to the editing.

Open up FINDCD.EXE in HEX Workshop and look for the line %c:\WIN51 (if you're using the linked FINDCD.EXE) or %c:\WIN98\SETUP.EXE (if it's the original FINDCD.EXE).

You're looking for what's in RED. Click over to where the numbers are, and find the position that corresponds with the \ after the %c:

start typing 0's. not O's, but ZERO's. This makes everything null. Type the zero's up till the next %. Don't 00 the %.

Alrighty then. Pick a file at the root of your CD. I chose WIN51 as my CD also has Windows XP on it. If you had a CD.TXT file you could use that. Or you could create your own, so that each disk is unique like AIO1.txt if you have different version of the disk.

Click over to the text side of the window. just after the %c: type \WIN51 and substitute WIN51 with your file, and be sure to include the file extension if there is one. Win51 doesn't have one, so I didn't. Also make sure that it's in ALL CAPS. I don't know if it really matters, but better safe then sorry.

============================================

What am I suppose to do with FINDCD.EXE after editing...? does anyone know?

Thanks

Link to comment
Share on other sites


Download FINDCD.EXE here.
Well, I don't see a link in your post. *hehe*
nasty IF EXIST lines

Really so nasty? I think it's better to have some IF EXIST lines based on the internal capabilities of the system instead of introducing even one more, little tool; especially when one first has to edit that tool to make it work in the desired way.

Btw: I use the FOR-command instead of several IF-lines. :) Looks pretty good, just one line, works like a charm and no extra tool needed. :rolleyes:

Link to comment
Share on other sites

you're supposed to drop it into your Win98/ME boot disc image.

I wrote that btw. You should have also used QUOTE tags. It looks better, and shows you're quoting.

And actually there are examples of how to use it.

set CDROM=FOO23
FINDCD.EXE

if "%CDROM%"=="FOO23" goto QUIT

That's how you use it.

The IF EXIST lines, could cause problems with ZIP drives or the like if you don't have a disc in the drive.

Link to comment
Share on other sites

  • 2 weeks later...
you're supposed to drop it into your Win98/ME boot disc image.

I wrote that btw. You should have also used QUOTE tags. It looks better, and shows you're quoting.

And actually there are examples of how to use it.

set CDROM=FOO23
FINDCD.EXE

if "%CDROM%"=="FOO23" goto QUIT

That's how you use it.

The IF EXIST lines, could cause problems with ZIP drives or the like if you don't have a disc in the drive.

Actually the findcd.exe is not necessary..

Link to comment
Share on other sites

And why is it bad to add one more, little tool? Windows' lack of "little tools" is what makes the monstrosity that is an unattended install necessary in the first place. In MacOS or UNIX/Linux the process is infinitely easier because they have a collection of little tools that do one thing very well, and the ability to effortlessly pass information between programs.

That Windows lacks these things is why people have to write them. In *ix I could just do:

CDROM=`echo list volume | diskpart | awk '/ROM/ {print $X}' | head -1`

where X is whatever column the drive letter is in. That would set CDROM to the first CD drive, whether it's a CD-ROM or a DVD-ROM. I'm not familiar with all the variations of what diskpart can output, but changing "ROM" to a more comprehensive regular expression would certainly be simple.

So, in conclusion, don't bemoan little tools. Little tools let you do stuff like that above, which Windows can't do out of the box. And it's certainly less "nasty" than 26 "IF EXIST" lines.

Give me findcd.exe any day. :)

Link to comment
Share on other sites

Hmm, looking into what findcd.exe actually does, it seems to only print out the drive letter of whatever drive the CD is actually in. That is, of course, functionally identical to %CD~0,2%, assuming the current working directory is somewhere on the CD-ROM. This still isn't a very reliable way to check, though, since there are perfectly normal processes that can break it. For example, it would be impossible to use /makelocalsource and have this still work. Also, if you're in a preinstallation environment %SystemDrive% will refer to the CD-ROM drive.

Link to comment
Share on other sites

For example, it would be impossible to use /makelocalsource and have this still work. Also, if you're in a preinstallation environment %SystemDrive% will refer to the CD-ROM drive.

Yes i agree, but most people here just want the CDROM location to create the RunOnce setup keys.

They are normally installing apps from the CD.

Link to comment
Share on other sites

yes....

but I hate to tell both of you this....

FINDCD.EXE DOES NOT WORK IN XP. :) It was meant SOLELY for the purpose of the Win98 Multiboot boot IMAGE.

%CD~0,2% won't work there as the local directory would be the A: drive, breaking the script. IF EXIST could cause a problem with empty ZIP drives.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...