VOGONS


First post, by drspock

User metadata
Rank Newbie
Rank
Newbie

Hi,

I'd like to know what is the easiest way to make a shortcut that will open DOSBox and run a .bat file.

I have made an x86 game in assembly language and it uses CGA graphics so it does not run natively under Windows Vista or under some Windows XP configurations. The game works mostly fine under DOSBox (the timing of the game does not work the same).

I just want to be able to make a shortcut that will automatically run DOSBox and then execute a .bat file so that when I offer the game for people to download, all they will have to do is download and install DOSBox, but never have to actually run DOSBox themselves and all they'll ever need to do is click on my DOSBox version shortcut.

Any advice is greatly appreciated.

Reply 1 of 16, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Do you know where people will put your game? Do you know what drive, what folder they will be using?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 3 of 16, by drspock

User metadata
Rank Newbie
Rank
Newbie

No I haven't specified a folder where it will be. But the shortcut just needs to work from the same directory like a .bat file does. Basically, I just need to make it so the user does not have to open DOSBox, mount a drive, and go through all of that just to run the game.

Also, could you tell me a little more about DOSBox portable and how I would go about that?

Reply 4 of 16, by Neville

User metadata
Rank Oldbie
Rank
Oldbie

What about copying BOTH the game and DOSBox in the same folder, if the license allows for DOSBox to be distributed in that way, then tweak the DOSBOX.CONF so that DOSBox mounts that folder as C: (mount c c:\), move to C: and finally runs the game program (all lines can be specified in the AUTOEXEC section).

Then the RUNME.BAT file could be as simple as:

@ECHO OFF
ECHO <Whatever message you want to insert here.>
PAUSE
DOSBOX

Yatta! 😁

Last edited by Neville on 2008-10-04, 20:56. Edited 2 times in total.

Reply 5 of 16, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

How about making a short-cut that simply says

%ProgramFiles%\DOSBox-0.72\dosbox.exe runme.bat

and specify the directory for the short-cut as P:\ath\to\your\BAT\file

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 6 of 16, by Neville

User metadata
Rank Oldbie
Rank
Oldbie

D'oh!!!!

You'd better try what MiniMax says. I just tried my idea, didn't work right. I've had problems mounting C: (C: meaning "this folder from drive C:") as C:\, DOSBox then reports folder "C:" doesn't exist.

There must be some runaround for this, but can't think of it right now. And anyway, it wouldn't work with all games, as some of them need to be installed in "XXX" folder to work, or simply don't like to be run from what they think is C:\. Found out this by DOSBox using frontends, they use to mount the game folder as C:\ unless you tell them otherwise.

Reply 7 of 16, by drspock

User metadata
Rank Newbie
Rank
Newbie

I don't really follow the logic as to how that would work. Doesn't DOSBox need to have a drive mounted before it will execute a command like that? Won't any of the front end programs that exist for DOSBox help me with this?

Reply 8 of 16, by Neville

User metadata
Rank Oldbie
Rank
Oldbie

Are you talking to me or to MiniMax? If you're talking to me, please ignore my previous messages.

I thought I had a solution for your problem, but that won't work. You'd better try dfollowing MiniMax's advice, see if it works for you.

Reply 10 of 16, by drspock

User metadata
Rank Newbie
Rank
Newbie

I was talking to MiniMax. And I don't really see what is any different about the portable version as opposed to the normal version. It seems either way I would need the exact path name where the .bat file is located. This is not a viable solution.

In Windows, when you click on a .bat file (or a shortcut to one), it will open an MS-DOS window, execute the .bat file, and once the program finishes it will close the MS-DOS Window, without having the end-user having to even know what DOS is or how to use it. There has got to be a way to achieve a similar effect with DOSBox. If I tried to force user's to install the game (or DOSBox) in a certain folder for it to work it would completely defeat the ease of use I'm trying to achieve.

Reply 11 of 16, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

When you click on a BAT-file. or a CMD-file, Windows will look at the extension (.BAT or .CMD) and it knows (because Bill told it so) which program to use (COMMAND.EXE or CMD.EXE).

Which magic do you propose should work, for getting 1000's of PC to know that DOSBox should be used to execute your program??

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 12 of 16, by Zorbid

User metadata
Rank Member
Rank
Member

The easiest way to achieve what you want is to put your game in the dosbox folder (or a subfolder thereof) and to use the autoexec section of the config file, with :

mount . c
c:
yourgame.com
exit

"mount . c" will mount the dosbox folder, whatever it is, as C:. You can of course use "mount .\yourgamefolder c" instead, if you want your executable to be in a subfolder.

Your users will only have to run DOSBox to play your game. You can rename the DOSBox executable to a more appropriate name if you want to, then put everything in an archive.

Your game should run, wherever the user unzips it.

You will of course have to offer a bigger file for download, but, for the user, it reduces the steps needed to play you game. Less friction == more success.

If you bundle DOSBox with your game, you have to provide the source for download as well, in a separate archive if you want, in order to comply with the GPL License.

Reply 13 of 16, by MiniMax

User metadata
Rank Moderator
Rank
Moderator
Zorbid wrote:

The easiest way to achieve what you want is to put your game in the dosbox folder (or a subfolder thereof)

You people should read what the original poster put up as his conditions:

drspock wrote:

I just want to be able to make a shortcut that will automatically run DOSBox and then execute a .bat file so that when I offer the game for people to download, all they will have to do is download and install DOSBox, but never have to actually run DOSBox themselves and all they'll ever need to do is click on my DOSBox version shortcut.

MiniMax wrote:

Do you know where people will put your game? Do you know what drive, what folder they will be using?

drspock wrote:

No I haven't specified a folder where it will be.

Those are the known conditions. Demanding that the game be installed in a specific folder (the DOSBox install folder) contravenes those conditions.

My solutions is right on the money! That the poster do not understand how it will work, or how to create said shortcut, is his problem, not mine.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 14 of 16, by Zorbid

User metadata
Rank Member
Rank
Member

I've read his first post, but, reading between the lines, I think he wants an easy way for his users to run his game, without having to configure DOSBox.

Am I right, drspock?

The users wouldn't have to put the game in a specific folder, since it would be bundled with DOSBox in the same archive (personally, I'd use a self extracting one).

Your solution requires the user (or an installer script) to set the path to the executable in the shortcut. Furthermore, it will break with the next version of DOSBox, and assumes that people use the default DOSBox install direrctory.

Reply 15 of 16, by drspock

User metadata
Rank Newbie
Rank
Newbie

Thanks Zorbid. That should work well enough for what I want to do. As I was trying to get across, the experience has to be as simple as humanly possible for the end-user.

@ Mini-Max
I don't really understand what part of me asking for help and your solution not being a viable one or if it is, you not explaining it to be as such to be such a problem. It is not really a leap to imagine that you could have a scripted shortcut program that would execute DOSBox, take care of the mounting, and execute a .bat file. I don't know why that idea seems so novel to you. I just assumed such a facility existed already for DOSBox given the large number of front-end apps that have been written for it.

Reply 16 of 16, by drspock

User metadata
Rank Newbie
Rank
Newbie

It didn't work at first because you meant to say "mount c . c". Thanks again.