![]() ![]() This has been tested and run in windows 7 other versions may need some small syntax changes.\%shortcut%.bat goto error2 if not %drive%=null echo A shortcut to the file %file% in the folder %folder% on drive %drive%:\ with the name %shortcut% has been created if %drive%=null echo A shortcut to the file %file% in the folder %folder% with the name %shortcut% has been created echo "To run %file% just type %shortcut%" goto again REM error messages and codes : error1 echo error (1): there is already a file with the name %shortcut% in this folder choice /m "overwrite file" if not errorlevel 2 goto override choice /m "chose another name for your shortcut" if errorlevel 1 set /P shortcut="Enter the name you want for the shortcut: " if errorlevel 1 goto : write goto end : error2 echo error (2): file creation failed goto end : again choice /m "do you want to create another shortcut" if errorlevel 2 goto end goto start : end pause \%shortcut%.bat goto error1 : override echo off > %shortcut%.bat if not %drive%=null echo %drive%:\ > %shortcut%.bat echo cd %folder% > %shortcut%.bat echo %program% > %shortcut%.bat echo cd \ > %shortcut%.bat if not exist. If errorlevel 1 set folder=%program% if errorlevel 2 set /P folder="Enter the name of the program folder: " choice /m "Do you want the shortcut to have the same name as the program file" if errorlevel 1 set shortcut=%program% if errorlevel 2 set /P shortcut="Enter the name of the shortcut: " choice /m "Do you want the shortcut to have the same name as the file" if errorlevel 1 set shortcut=%file% if errorlevel 2 set /P shortcut="Enter the name you want for the shortcut: " choice /m "Is the file on the same drive as the shortcut" if errorlevel 1 set drive=null if errorlevel 2 set /P drive="Enter the correct drive letter: " write if exist. shortcut is C:short (in DOSBox) and file is C:\folder\file REM say no if folder is C:\prog\folder\file and if shortcut is in C:\shortf\short use the full path : start set /P file="Enter the name of the program: " choice /m "Does the program folder have the same name as the program file (only if folder is in shortcut directory): " REM i.e. The important parts of the code are in bold.Create a batch file in the directory you want the shortcuts to be in lets call it short.bat and copy this to it.Unfortunately this version can't be run from dosbox due to the set /P command not being supported by DOS 6 and some other syntax changes if you follow the link at the bottom of the page you can download a dos version that uses Horst's INPUT.COM. ![]() You can write a program to do this quickly.If autoexec is empty then you will need to add the lines. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |