Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I would like to edit the autoexec.bat on my win98 boot floppy so that it changes directly to the 'd:'drive and execute either a .bat or an .exe.
I have added this to the end of my autoexec.bat
d:\
file.batThat dumps me to the d:\ prompt but does not run the .bat file I have there. I can type 'batchfilename' though and it will work. I'm close but apparently the syntax is getting the better of me.
Thanks for any help folks.

Weird, it must says (or do) something when it comes to the line where you specified that batch program ...
just run it from dos, take out the "echo off" command, to see what he is doing exactly
by the way, the command to switch to D: drive is :
D:
not
D:\
and also, calling a batchprogram may be done by :
call somefile.bat
in stead of
somefile.bat
(depends on what DOS you are running), if this command is the latest in the list, it doesnt matter, but otherwise it does

Actually there are a few ways to try this, but it can depend on your OS. For example, if you are running DOS (as in a boot disk) then you could easily have a command at the end of the autoexec.bat file such as this: d:\runthis.bat
With Windows 9x it works the same, but Windows may still try to load. In that case, if you do not want Windows to load then you must use the EXIT command.
The "call" command can also be used as Miskva explained. Using the "call" command will allow the batch file to return from where it came (returns to the batch file that called it). Not using the call command will not return it to the original batch file.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |