VOGONS

Common searches


First post, by BravoBravo

User metadata
Rank Newbie
Rank
Newbie

Hello, I've been trying to find the proper commands to send Windows environment variables to DosBox.

Have been looking through the documentation and either not finding it, or not comprehending what I'm seeing (maybe a little of both).

Can someone point me in the right direction?

A little background: just upgraded to 64bit Windows and need to use a file conversion program, which of course is old and proprietary. Invoking the program in DOS reads like: Conv-lxn filename.lxn

My prior scripts (32bit) listed, sorted and stored the name of the file into a windows enviroment variable; a seperate script just invoked the command listed above with Conv-lxn %latest%

Now that I'm 64bit, I'd like to use DosBox to perform the same trick. Except I dont know how to load a windows environment variable into a DosBox environment variable.

Also, the next step i'm having trouble with as well: assuming I can get the variable pass-thru, I can't seem to get DosBox command line to behave the same.

When manually storing a variable for testing, and typing; conv-lxn %latest%, that doesn't work either.

So if anyone can point me in the right direction, I would be most appreciative.

Thanks, (and running old DOS games is going to be fun too!)

BB

Reply 1 of 6, by mr_bigmouth_502

User metadata
Rank Oldbie
Rank
Oldbie

It looks like you may just have to dual-boot 32-bit and 64-bit OSs. As far as I know, DosBox basically acts like a seperate machine within your machine, so I doubt that it would be able to pass system variables to the host OS.

Reply 2 of 6, by collector

User metadata
Rank l33t
Rank
l33t

Mount and add a path statement to the folder in the [autoexec] section of the dosbox.conf.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 3 of 6, by frobme

User metadata
Rank Member
Rank
Member

You could use a Windows batch file to construct the DOS batch file on the fly, echo'ing in the contents of the environmental variable.

Given the filename in the Windows environmental variable foo,

SET echoline=conv-lxn %foo%
echo echoline > dosbox.bat

Then start Dosbox with a conf file that runs dosbox.bat. You have to go through the goofiness with the set echoline= because Windows echo doesn't have an option to suppress newline if you use it in multiple parts.[/code]

Reply 4 of 6, by BravoBravo

User metadata
Rank Newbie
Rank
Newbie

Ah Perfect! why didn't I think of that? let Windows do all the work and use another level of scripting to get DosBox to perform the action only.

thanks for the heads up!

Now to determine how to invoke DosBox from a DOS script and supress the windows...

thanks again!

Reply 5 of 6, by frobme

User metadata
Rank Member
Rank
Member

Now to determine how to invoke DosBox from a DOS script and supress the windows...

You can't without source code modifications to DosBox (the easiest would be to bring the window up marked as not visible in a Windows sense). That would seem a minor inconvenience though...

-Frob

Reply 6 of 6, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie
frobme wrote:
You could use a Windows batch file to construct the DOS batch file on the fly, echo'ing in the contents of the environmental var […]
Show full quote

You could use a Windows batch file to construct the DOS batch file on the fly, echo'ing in the contents of the environmental variable.

Given the filename in the Windows environmental variable foo,

SET echoline=conv-lxn %foo%
echo echoline > dosbox.bat

Then start Dosbox with a conf file that runs dosbox.bat. You have to go through the goofiness with the set echoline= because Windows echo doesn't have an option to suppress newline if you use it in multiple parts.[/code]

This is exactly the advice I was looking for, but I found that I had to write the batch file with percent signs like this (under Windows XP):

SET echoline=conv-lxn %foo%
echo %echoline% > dosbox.bat

If I'm wrong about this, I'll delete the post, but I posted because someone else might find it useful (if it's right).