Old DOS program and XP

D

Donald Canton

Hi,

I have a very old DOS program, COMPUTE.COM, that takes a string of
numbers and operators from the command line and computes the
arithmetic result. The program also saves the answer within itself so
the next time it's called the previous answer can be used as part of
the current computation. When I execute this program from my XP Home
(ntfs) CMD prompt, it works fine the first time only, but after that I
get the following error message:

Could not save answer in Compute.com
Compute.com must be in current directory
or in DOS PATH= directory.

Since I'm executing it from the current directory, the program
shouldn't need a search path. It still computes the answer, it just
doesn't store it anymore. Any ideas will be much appreciated as I
find this little program very useful at times.

As an afterthought, is it safe to be executing this program as I'm
sure it uses the old DOS interrupts to write to a FAT16 file system?

Donald Canton
 
G

Gordon Everstine

Donald Canton said:
I have a very old DOS program, COMPUTE.COM, that takes a string of
numbers and operators from the command line and computes the
arithmetic result. The program also saves the answer within itself so
the next time it's called the previous answer can be used as part of
the current computation. When I execute this program from my XP Home
(ntfs) CMD prompt, it works fine the first time only, but after that I
get the following error message:

Could not save answer in Compute.com
Compute.com must be in current directory
or in DOS PATH= directory.

Since I'm executing it from the current directory, the program
shouldn't need a search path. It still computes the answer, it just
doesn't store it anymore. Any ideas will be much appreciated as I
find this little program very useful at times.

As an afterthought, is it safe to be executing this program as I'm
sure it uses the old DOS interrupts to write to a FAT16 file system?

I also run WinXP Home with NTFS, and compute.com works fine for me. I
suspect your read-only attribute is on (which happens if the program has
been copied from a CD).
 
K

Ken Blake, MVP

In (e-mail address removed)
XP doesn't use Fat16. Only Fat32 and NTFS.


Not at all true. XP supports all combinations of NTFS, FAT32,
FAT16, and FAT12.


I don't
think XP really supports DOS.


Correct. It only emulates it. Any program that tries to do its
own file I/O will not run under XP.
 
D

Donald Canton

Gordon Everstine said:
I also run WinXP Home with NTFS, and compute.com works fine for me. I
suspect your read-only attribute is on (which happens if the program has
been copied from a CD).

Read-only attribute is cleared.
 
A

Alex Nichol

Donald said:
I have a very old DOS program, COMPUTE.COM, that takes a string of
numbers and operators from the command line and computes the
arithmetic result. The program also saves the answer within itself so
the next time it's called the previous answer can be used as part of
the current computation. When I execute this program from my XP Home
(ntfs) CMD prompt, it works fine the first time only, but after that I
get the following error message:

Could not save answer in Compute.com
Compute.com must be in current directory
or in DOS PATH= directory.

I think the trouble will be that the program is trying to save results
in its own program file. And this is open by the system which can't
then open it for update. I think I would take a Hex editor, look for
that COMPUTECOM in the file itself, and change a letter - or even change
the program's extension to .exe, when it may still run, and supply a
separate file for the data to be stashed in
 
D

Donald Canton

Alex Nichol said:
I think the trouble will be that the program is trying to save results
in its own program file. And this is open by the system which can't
then open it for update. I think I would take a Hex editor, look for
that COMPUTECOM in the file itself, and change a letter - or even change
the program's extension to .exe, when it may still run, and supply a
separate file for the data to be stashed in.

Thanks for the advice. Suppose I use debug to change the filename,
what are the chances of damaging my file system if inadvertently
change some other program code in the file and then execute it?
 
A

Alex Nichol

Donald said:
Thanks for the advice. Suppose I use debug to change the filename,
what are the chances of damaging my file system if inadvertently
change some other program code in the file and then execute it?

Not very much. But I would try to find an easier tool than debug -
there are free hex editors around on shareware sites, and very difficult
to make serious mistakes with them if just changing one letter in such a
name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top