My batch file seems to have two problems, one of which is that FreeDOS does
not allow compound IFs and/or FOR nesting of any kind. I can work around
that, but the second problem is the one that I'm really struggling with.
Some background: When I boot up using my new CD, the floppy drive image is
assigned drive A:. The CD itself is assigned drive Y:. My computer has one
physical hard drive with two partitions, the first being NTFS and the
second FAT32. The FAT32 partition gets assigned drive letter C: while NTFS
does not get a drive letter (of course). I also load a USB driver which
assigns my thumb drive with the letter E: So far, so good.
So I'm trying to use some of the code below in a batch file to see which
drives are present. Things go well until we try the following:
IF EXIST D:\NUL ECHO Y
Error reading from Drive D: DOS area: unknown command given to driver
The same thing happens when I use WHICHFAT D:. I've read about similar
problems happening using FreeDOS within DOSEMU in Linux. All versions of
MS-DOS and the command line interpreter within Windows fail gracefully
(i.e.: they don't report a drive), even for DOS 6.22.
Any installation program really needs to know three things:
-- Does a drive exist
-- Is it writeable
-- How much free space is present.
If I can't meet these objectives then I'm pretty much at an impasse. If
anyone can offer an alternative please advise.
Thanks,
Bruce
On Tue, Nov 27, 2012 at 2:30 PM, bruce.bowman tds.net
<bruce.bow...@tds.net>wrote:
> Right now I have something like this going on.
>
> A: is the floppy bootup image.
> B: could be a floppy so I don't want that to be probed
> Y: is the drive letter assigned to the CD that I booted from.
> Z: is a ramdrive.
>
> for %%d in (c d e f g h i j k l m n o p q r s t u v w x) do (
> if exist %%d:\mygame\ (
> cls
> echo.
> echo.
> echo.
> echo A previous installation of MYGAME was found on drive %%d:
> choice /B /N /C:YN /T:Y,10 Should I run the game from this location
> [recommended]
> if not errorlevel 2 (
> swsubst %progdisk% %%d:\mygame\
> goto finish
> )
> )
> )
>
> REM either didn't find an installation, or didn't want to use it
> set progdisk = z:
> copy Y:\mygame\*.* %progdisk% > nul
>
> :finish
> %progdisk%
> rungame
>
> FreeDOS doesn't seem to like the compound IF very much. Thoughts
> appreciated.
>
> Bruce
>
>
> On Tue, Nov 27, 2012 at 1:49 PM, Bernd Blaauw <bbla...@home.nl> wrote:
>
>> Op 27-11-2012 6:45, bruce.bowman tds.net schreef:
>>
>> > In fact I am essentially done with my project but still want something I
>> > can throw in a batch file to probe for writeable drive letters so I can
>> > give the user an opportunity to save a game and resume later (like they
>> > used to).
>>
>> DOS kernels only assign driveletters to FAT filesystems. For (emulated?)
>> floppy drives A: and B: get assigned, thus C: till Z: get assigned to
>> everything else.
>>
>> A FAT filesystem contains the NUL blockdevice, making it easy to test:
>>
>> @echo off
>> IF EXIST C:\NUL echo Driveletter C: points to a FAT filesystem.
>>
>> Testing if you can store files on the drive is a different issue
>> altogether, as it involves:
>> * checking if the drive isn't full yet
>> * checking if the drive isn't write-protected (read-only)
>> * checking if there's enough free diskspace
>>
>> Bernd
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>> _______________________________________________
>> Freedos-user mailing list
>> Freedos-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/freedos-user
>>
>
>
>
> --
> Sent from my meager, humble desktop computer.
>
>
--
Sent from my meager, humble desktop computer.
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user