Difference between revisions of "Shortcuts that You Run in DOSBox"

From DOSBoxWiki
Jump to: navigation, search
(made the code more dynamic, allowing for programs that have a different name for the program and program file (i.e. cd "program file"; and pf.exe))
Line 16: Line 16:
 
: ''cd \''
 
: ''cd \''
 
* and to run it all you need to do is type 'hospital'.
 
* and to run it all you need to do is type 'hospital'.
 +
* If autoexec is empty then you will need to add the lines
 +
** ''mount C C:\folder''
 +
: and
 +
: ''C:\''
 +
 +
= A Small Shortcut Maker =
 +
 
* You can write a program to do this quickly
 
* You can write a program to do this quickly
* Unfortunately this can't be run from dosbox due to the set /P command not being supported by DOS 6.22 (if there is a native command that will allow for the input of a string then feel free to modify the code)
+
* Unfortunately this can't be run from dosbox due to the set /P command not being supported by DOS 6.22 (if there is a native command that will allow for the input of a string then feel free to modify the code you will also have to change the choice syntax from choice [/m "text"] to choice [text])
 
* Create a batch file in the directory you want the shortcuts to be in lets call it short.bat and write this to it
 
* Create a batch file in the directory you want the shortcuts to be in lets call it short.bat and write this to it
 
** ''@echo off''
 
** ''@echo off''
 
: ''set /P program="Enter the name of the program: "''
 
: ''set /P program="Enter the name of the program: "''
 
: ''echo @echo off > %program%.bat''
 
: ''echo @echo off > %program%.bat''
: ''choice does the program folder have the same name as the program file''
+
: ''choice /m "Does the program folder have the same name as the program file"''
: ''if errorlevel 1 set /P programf="Enter the name of the program Folder: "''
+
: ''if errorlevel 1 set /P programf="Enter the name of the program folder: "''
: ''if errorlevel 2 echo cd %program% >> %program%.bat''
+
: ''if errorlevel 2 programf=program''
 +
: ''echo cd %programf% >> %program%.bat''
 
: ''echo %program% >> %program%.bat''
 
: ''echo %program% >> %program%.bat''
 
: ''echo cd \ >> %program%.bat''
 
: ''echo cd \ >> %program%.bat''
 
* If autoexec is empty then you will need to add the lines
 
** ''mount C C:\folder''
 
: and
 
: ''C:\''
 

Revision as of 18:13, 28 January 2012

  • This will allow you to use a shortcut to your program using a batch file that you run in DOSBox it's self.
  • This way you can keep you mount settings
  • Create in the root directory of the folder you use primarily for DOSBox a text file and rename it [program].bat
  • The shortcuts will need to be in the same (mounted) drive as the program(s) you want to run
  • Open it in notepad and type
    • @echo off
cd [program dir]
[program]
cd \
REM once the program is closed this will take you back to the root directory
  • To run it (provided your autoexec has something like "mount C C:\folder", C:\ and [program].bat is in C:\folder) just type [program].
  • So for theme hospital that would be 'hospital.bat' and
    • @echo off
cd hospital
hospital
cd \
  • and to run it all you need to do is type 'hospital'.
  • If autoexec is empty then you will need to add the lines
    • mount C C:\folder
and
C:\

A Small Shortcut Maker

  • You can write a program to do this quickly
  • Unfortunately this can't be run from dosbox due to the set /P command not being supported by DOS 6.22 (if there is a native command that will allow for the input of a string then feel free to modify the code you will also have to change the choice syntax from choice [/m "text"] to choice [text])
  • Create a batch file in the directory you want the shortcuts to be in lets call it short.bat and write this to it
    • @echo off
set /P program="Enter the name of the program: "
echo @echo off > %program%.bat
choice /m "Does the program folder have the same name as the program file"
if errorlevel 1 set /P programf="Enter the name of the program folder: "
if errorlevel 2 programf=program
echo cd %programf% >> %program%.bat
echo %program% >> %program%.bat
echo cd \ >> %program%.bat