Solved

Restart in Dos, Run Dos game...maybe a batch file???

Posted on 2004-10-31
551 Views
Last Modified: 2013-12-29
I want to be able to restart my computer in Ms Dos mode and have it automatically start up a game that needs to be run.  Right now I have written a batch file that I can run (bth.bat) after I restart in Ms Dos by typing in bth at the command prompt.  The batch file also loads a dos mouse driver.  Its a very simple batch file...ie

c:\msmouse\mouse.exe
cd c:\bth
bth.exe

I just type in bth (the name of the batch file) at the command prompt and that loads the mouse driver then changes the directory to the bth directory then runs bth (the game)

What I want to do is just be able to click on an icon while windows is running and have it restart in dos and do all that for me without having to manually restart in dos mode then typing in bth at the command prompt.  I have tried running the game from windows but it does not work properly and there is no mouse.

I don't necessarily have to use a batch file, that's just the only way I know to do it at the moment.  
Anyone know how I can do what I want to do.

Thanks and Cheers,
ahammar
0
Question by:ahammar
    20 Comments
     
    LVL 13

    Expert Comment

    by:gonzal13
    I would not default from the dos prompt to the game at all. What happens when you want to be in the dos mode for other reasons?
    0
     
    LVL 33

    Expert Comment

    by:_
    I seem to remember a command or program to restart in DOS mode. I will see if I can find it again. But in the mean time, you should be able to add the command   bth.bat   to the AUTOEXEC.BAT file in the root dir ( C:\ ) and have it run when you reboot to DOS from the START MENU.
    0
     
    LVL 33

    Expert Comment

    by:_
    In response to gonzal13, you can modify  bth.bat to give you a choice on whether to run or exit to DOS.
    0
     
    LVL 13

    Expert Comment

    by:gonzal13
    Coral47:
    Thanks, I forgot that option. I still have my dos books!

    Joe
    0
     
    LVL 33

    Expert Comment

    by:_
    >> dos books <<  Me too. They still come in handy once in awhile.    : D
    0
     
    LVL 9

    Assisted Solution

    by:paraghs
    In your Windows folder, there is a file named COMMAND.PIF. Copy it to any location you like.

    Next, right-click on this file at new location, click "Properties". Under "Program" tab, in "CMD LINE", change the path to that of your exe file.

    Click on "Advanced" button. Check "MS-DOS MODE".

    0
     
    LVL 33

    Accepted Solution

    by:
    : /  I am still to slow.

    You can also do this by going to START > PROGRAMS and coping the MSDOS prompt to the desktop, right click properties, and adding your .BAT file to the "batch file" under the programs tab and setting any other things you need under the other tabs.
    0
     
    LVL 33

    Expert Comment

    by:_
    Forgot: you can rename the MSDOS PROMPT icon while in the programs tab.
    0
     
    LVL 9

    Expert Comment

    by:paraghs
    There is no need for batch file, as you can specify the executable file name, as well as working directory, under Program tab. Mouse support will be there.

    Of course, you can rename the link, as well as change the icon under Program tab.
    0
     
    LVL 38

    Assisted Solution

    by:BillDL
    Another easy way is to ensure that you always are shown a boot menu with the option of booting to DOS every time your system starts up.

    Open c:msdos.sys in Notepad, and add these 4lines after the last row of x's:

    BootMenu=1
    BootMenuDelay=7
    Bootkeys=1
    Logo=0

    Save the file again.

    You will have 7 seconds to choose an option, otherwise Windows will boot normally.

    To load the mouse driver in DOS from that folder, you should change the batch file to:

    LH c:\msmouse\mouse.exe
    c:\bth\bth

    One of the easiest ways of loading an environment suitable for DOS games is by booting to a boot floppy that sets everything up, and then launches the game.

    I recall messing with such a boot floppy a while back, but I will need to find it again.  
    Here's one that I happened upon, but you would also need to download some drivers for it.  The download is a self-extracting file that will create a boot floppy from a blank one.  You would then just have to copy the extra driver files to wherever is specified in autoexec.bat and config.sys:

    http://www.abandonia.com/main.php?nav=bootdisk
    http://www.abandonia.com/utility/system_disk.exe
    http://www.abandonia.com/main.php?nav=drivers

    Here's a couple of other resources explaining how to make a boot floppy:

    http://www.classicpcgames.com/?p=faqbootdisk
    http://support.lucasarts.com/system/bootdisk_instructions_real_mode.htm

    I believe that boot floppy may have been on my old Win95OSR2 CD.  I'll get back to you.

    I'm not sure if you are aware of this, but you can make your own .PIF file and name it anything you want to.  A .PIF file is to DOS what a .LNK file is to Windows, ie. a "shortcut" to another file.  When you Right-Click on a PIF file and choose "properties", you can change the settings without affecting the properties of the file it is pointing to.

    To find out what the settings are, just click the ? to the left of the X in the top corner of the "properties" dialog box and then click on the item you want to find out about.

    If you drag a DOS .exe of .bat file with your RIGHT mouse button, release it, and select "Create Shortcut Here", it will turn into a .PIF file but the .PIF file extension becomes hidden.  It will display the MSDOS icon, but this can be changed to another icon file using the "properties" > "program" tab.  You'll see the "Change Icon" button.  There are a selection of icons readily available if you browse to c:\windows\system\pifmgr.dll  or c:\windows\MORICONS.DLL.  Of course, the icon doesn't matter in DOS, but it's always nice to have a suitable icon for files in Windows rather than the boring old DOS icon.

    Run the program from bth.pif and it will load with the properties set there.

    A handy way of restarting a computer from FULL DOS is by using the file RESTART.COM.  If you have either a win98 boot floppy or the folder c:\windows\command\ebd, you will see a file named ebd.cab.  Use WinZip to extract the contents to any folder, and then keep the file restart.com.

    Place a copy of it in your c:\ drive or in c:\windows\command (or even on a floppy) and you should be able to reboot by typing the command RESTART as long as it is in a "path" already identified to the environment.

    To restart from windows with a single click, and then boot to the menu that will show if you modified msdos.sys (this is the same menu shown if you press F8 early in the boot process), all you have to do is execute the command:

    rundll32 shell32,SHExitWindowsEx 2

    This is derived from the following, where y is the SUM of any of the options chosen:

    rundll32 shell32,SHExitWindowsEx y

    0 - LOGOFF
    1 - SHUTDOWN
    2 - REBOOT
    4 - FORCE
    8 - POWEROFF

    So, to force a shutdown, the y would be 5.

    Do it from a batch file with:

    @echo off
    START C:\WINDOWS\RUNDLL.EXE user.exe,exitwindowsexec
    exit

    or

    @echo off
    START rundll32 shell32,SHExitWindowsEx 2
    exit

    OR, just create a new shortcut on your desktop (Right-Click > New > Shortcut) and type the command into the command line field.  Click "Next" and name it something like "reboot".  The icon will change, and you should have a reboot shortcut.
    0
     
    LVL 9

    Expert Comment

    by:paraghs
    BillDL,

    You have given a very elaborative response, but missed the point that ahammer wanted "just be able to click on an icon while windows is running and have it restart in dos". The method suggested by me and coral47 is sufficient for this purpose.
    0
     
    LVL 38

    Expert Comment

    by:BillDL
    Yes, but there is more than one way to skin a cat  ;-)

    The rundll command is a simple double-click, the F8 boot menu is an arrow down and <enter> and by sticking a boot floppy in the drive before you double-click the rundll shortcut, you wouldn't see the F8 menu and it would start the game automatically, but only when you choose to insert the floppy.
    0
     
    LVL 23

    Author Comment

    by:ahammar
    Wow....
    Thanks for all the comments.  I am off to work now, but I will be back tonight to take a closer look at these possibilitites when I have a little more time.  Looks like something here may work.....Thanks again and I'll be back later....

    Cheers!
    ahammar
    0
     
    LVL 23

    Author Comment

    by:ahammar
    Hi everyone,

    Well, I've worked on it for awhile and I finally got it to work.  I'm not sure how to give the points now though.  I tried putting the path the the batch file in the autoexec.bat file, but that had no effect at all.  There wasn't a file anywhere named command.pif...I even did a search for it.  I tried copying the msdos prompt shortcut to the desktop but the boxes where I would put a reference to the bth.bat file were greyed out so I couldn't do that.  What I ended up doing was just double-clicking on the bth executable directly from windows explorer and then windows brought up a message asking me if I wanted to change the shortcut properties so that it always started in msdos mode.  I clicked yes and then I was able to add my batch file to that batch file box as coral47 suggested.  I also added the working directory of the game in the working directory box and it works fine.  It restarts in msdos, then runs the game.  I don't know why I wasn't able to do that by just creating a shortcut to the executable, but it wouldn't let me. The shortcut that windows created for me is a PIF file.  I think I actually got the most information that helped me out from coral47 and paraghs.  The information I got from BillDL was very interesting though.  That may be useful to me as I was already familiar with that, but I didn't know about the different options.  I was only aware of shutting down that way.  I was not aware of the other 4 or how to make it work, so that is very useful to me in other ways.  I think what I want to do is increase the points to 200 then split them up...75 for coral47, 75 for paraghs, and 50 for Bill DL.  I guess I didn't really get any info from gonzal13 this time but maybe next time.
    Is this ok with everyone??  If not, don't be afraid to speak up....:)

    Cheers!
    ahammar

    0
     
    LVL 33

    Expert Comment

    by:_
    ahammar:  Sounds like a winner to me.  Glad it is working.

    BillDL: Thanks for the refresh on the rundll command <meow>   : )
    0
     
    LVL 9

    Expert Comment

    by:paraghs
    I am happy the way you have split the points.

    But, I am wondering why you didn't find command.pif. Another way of creating DOS-PROMPT shortcut is to create a shortcut to the COMMAND.COM file (hey, this MUST be there in your Windows directory).

    Thanks.
    paraghs
    0
     
    LVL 38

    Expert Comment

    by:BillDL
    That sounds fine to me, ahammer, and thank you for deciding to include me.

    The possible reason that you didn't find command.pif is because the .PIF file in Windows is "always hidden" (registry value named "NeverShowExt") and all you would see is a file named "command".  A right-click > "properties" on any file always shows the "MS-DOS Name" in the "general" tab, though.

    Right-Click on the DOS Prompt icon on your start menu and you'll see what I mean.  DON'T modify that in any way, or you may get some unwanted behaviour the next time you want a simple little DOS box, eg. starting in full screen, or with massive fonts.

    Windows 3.1 came with a utility named PIFEDIT.EXE that allowed you to enter all of the settings manually, so you had to know what you were doing.  The accompanying help file PIFEDIT.HLP is actually quite informative, if you know anyone who still has 3.1 running on a computer.

    If you commonly play a few old DOS games on your computer, then I reckon you should brush up on some DOS and create a batch file with a menu that allows you to choose which game you want to play, and then runs it through its own .PIF file with settings tailored for that game.  Old games usually have some sort of readme file that tells you what settings the game likes best, and that way you could get each one to load different settings.  Just a thought.

    Ask another question, quote the paths to the games along with the optimal settings, and I'll write you a nice neat menu  ;-)
    0
     
    LVL 23

    Author Comment

    by:ahammar
    Ok, I'm glad everyone like that.  I don't know how this is going to work, so I will increase the points with this comment and submit it, then split the points after that...

    Thanks and Cheers!
    ahammar
    0
     
    LVL 33

    Expert Comment

    by:_
    Thank you much.    : )
    0
     
    LVL 38

    Expert Comment

    by:BillDL
    Thank you, ahammer.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    * Windows Operating System (OS) & its applications offer us a range of ways to access/execute an operation using keyboard shortcuts. *  One of the ways to access the shortcuts is with the help of 'Alt' button. * When you only press the button …
    The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
    The viewer will learn how to download, install and use CrashPlan from Code42.com on Windows 7. Open your browser and go to crashplan.com: Click get started, it’s free then Click the Download CrashPlan button: Click save in Internet Explorer, the…

    931 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now