VOGONS

Common searches


First post, by EMJ

User metadata
Rank Newbie
Rank
Newbie

In real DOS machines I had a small program capable to set environment variables.
This is a very valuable asset for batch enhancement, it allows to get strings into environment variables, manipulate them, etc.
This is not possible under Windows since any program running gets a copy of the environment, and when the program exit the original environment is restored.
Any SetEnvironment(Variable,Value) procedure will not change the system environment, only the child environment.

I wonder if this small program called "WHAT" could work under DOSbox, for the opened DOSbox window, of course, even if I need to make some code for it.

I attach the "WHAT" program code and EXE.
Thanks
Eli

Attachments

  • Filename
    WHAT.rar
    File size
    9.33 KiB
    Downloads
    172 downloads
    File comment
    Source and Executable
    File license
    Fair use/fair dealing exception

Reply 1 of 5, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie

Why don't you just try it yourself?

I don't quite understand the problem, or your question. Do you want to change environment variables on the host OS from an emulator?! That kind of "functionality" would be considered a major bug and security flaw in the emulator. Emulators and Virtualizers are supposed to run in a "closed" environment, that's one of the basic ideas of emulation/virtualization.

I'm using 4DOS for my DOSBox batch files. It's free and open source now, and still being developed. Works very well for me.

Reply 3 of 5, by EMJ

User metadata
Rank Newbie
Rank
Newbie

To clarify a little more here is an example:
I do a batch file to do some process.This will be the batch code:
WHAT S "---Enter file name to process:"
PROCESS %WHAT%

When the batch file start it will prompt :
---Enter file name to process:
Then the user types (for example) :
MYFILE.DRW
The line will look:
---Enter file name to process: MYFILE.DRW
And when he hits enter the next line in batch will execute:
PROCESS MYFILE.DRW

No system environment variable outside the DOSbox has been changed.

How can I do this "WHAT" program or any similar to work under DOSbox?

I hope I have been more clear now.

Reply 5 of 5, by EMJ

User metadata
Rank Newbie
Rank
Newbie

Sorry, my fault, WHAT works fine under DOSbox.
I was thinking it didn't work because the batch didn't do the job an I knew what was the problem with a standard command prompt window.

The batch didn't work because it uses other two small programs.

One is called "KEY-FAKE" it types initial commands to a program just started instead of the user.
For example if the program PROCESS always needs the user to type "12DY" to make the job you could make a batch:
WHAT S "---Enter file name to process:"
KEY-FAKE "12DY"
PROCESS %WHAT%

How can I make "KEY-FAKE" to work?

Attachments

  • Filename
    KEY-FAKE.rar
    File size
    477 Bytes
    Downloads
    333 downloads
    File license
    Fair use/fair dealing exception