Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
CluelessInSeattl(R)

Seattle, USA,
31.12.2012, 16:00
 

AUTOEXEC.BAT: Must I reboot to run it? (Users)

Can I make a change in my AUTOEXEC.BAT file and then just run the revised file, without rebooting the machine?

I'm running MS-DOS 6.21 along with DOSSHELL from DOS 5.0. So I have a number of programs running under DOSSHELL. I also have a RAM disk with a lot of files on it. I usually leave the computer on in sleep mode, so that I don't have to reboot it each time I want to use it.

I'd like to test a modified AUTOEXEC.BAT file, without having to go the the trouble of rebooting my machine, reloading all my programs under DOSSHELL, and copying all my files from floppies onto the RAM drive.

Would I be risking messing up my system if I were to make a minor change in the AUTOEXEC.BAT file, and then just run it from a DOS prompt under DOSSHELL?

The change I want to make in the AUTOEXEC.BAT file is a simple one. All I want to do is remove the /p switch from the this line:

SET DIRCMD=/o/a/p

Now that I think of it, maybe all I have to do create a .BAT file containing a revised SET DIRCMD line. That makes more sense, doesn't it?

Or, could I even just run the SET command from the DOS prompt? Or will DOS only recognize it if it's contained in an AUTOEXEC.BAT file?

Will in Seattle
a.k.a. "Clueless"

If you're wondering what the back story to my query is: I've spent the last week or so trying to debug an old QuickBASIC program I wrote well over a decade ago.

It used to run OK back when I wrote it in the 90s, but when I recently cranked up my ancient MS-DOS system again and tried to run it, that program would just lock up.

After a week of head scratching, and lots of consultations over at a QBasic and QB64 Discussion Board I stumbled on the solution to the problem:

Somewhere along the line, way back when, I had added SET DIRCMD=/o/a/p to the AUTOEXEC.BAT file I had been running on my old (and now, long since, dead) laptop.

When I revived my old MS-DOS and QuickBASIC projects this year, I just copied over the AUTOEXEC.BAT file containing that SET DIRCMD line from the hard drive of that old dead laptop

I had long since forgotten about that SET DIRCMD line in that AUTOEXEC.BAT file.

Well, it turned out that the very first action my my old .BAS file performed was SHELL "DIR>FILE.LST"

And then it opened the FILE.LST file to extract the names of the files, open each file, and then extract the first line of each file. Of course it choked when it it came across the line: "Press any key to continue . . ." Because no such filename exists in MS-DOS.

Laaca(R)

Homepage

Czech republic,
31.12.2012, 17:25

@ CluelessInSeattl

AUTOEXEC.BAT: Must I reboot to run it?

> Can I make a change in my AUTOEXEC.BAT file and then just run the revised
> file, without rebooting the machine?

Unless you are an expert - NO

---
DOS-u-akbar!

CluelessInSeattl(R)

Seattle, USA,
31.12.2012, 18:22

@ Laaca

AUTOEXEC.BAT: Must I reboot to run it?

Thanks for the heads-up, Laaca(R)!

I'm certainly no expert, so "better safe than sorry."

---
Will in Seattle
a.k.a. "Clueless"
Running MS-DOS 6.21

j_hoff(R)

31.12.2012, 20:05

@ CluelessInSeattl

AUTOEXEC.BAT: Must I reboot to run it?

> Would I be risking messing up my system if I were to make a minor change in
> the AUTOEXEC.BAT file, and then just run it from a DOS prompt under
> DOSSHELL?

The general answer is: "YES"

_BUT_

To get the full story you would have to look into the details.

> Or, could I even just run the SET command from the DOS prompt?

In that special case it would most probably work and it even is the preferred way to do it.

If you just enter the command "SET" at the command prompt (without any arguments) you get the list of currently defined environment variables. In this list you should also find your "DIRCMD=/o/a/p".

Now just enter "SET DIRCMD=/o/a" (without the "/p") and then enter "SET" again. You should see your list of environment variables but now with modified value for "DIRCMD". It will stay that way until you change it again or reboot the computer.

If the manual change yields the result you expected, you should duplicate the change in AUTOEXEC.BAT, in order to make it permanent. If it turns out to be not what you want, don't change AUTOEXEC.BAT, reboot and everything will be as it was before.

Rugxulo(R)

Homepage

Usono,
03.01.2013, 10:49

@ CluelessInSeattl

AUTOEXEC.BAT: Must I reboot to run it?

> Thanks for the heads-up, Laaca(R)!
>
> I'm certainly no expert, so "better safe than sorry."

It's just a .BAT file, but it's (usually) autorun from the resident shell at startup. Usually people put defaults in there like TSRs and env. vars. There no explicit reason you can't rerun it, but usually it won't work like you want (and most TSRs aren't smart enough to not load twice or unload or similar niceties). But just resetting env. vars doesn't need a reboot, as you've discovered. (For loading device drivers, usually I do such in CONFIG.SYS, but some you can load in AUTOEXEC via something like DEVLOAD.)

CluelessInSeattl(R)

Seattle, USA,
03.01.2013, 17:18

@ j_hoff

AUTOEXEC.BAT: Must I reboot to run it?

> > Or, could I even just run the SET command from the DOS prompt?

j_hoff replied:
> In that special case it would most probably work and it even is the
> preferred way to do it.

Many thanks, j_hoff, for your helpful repy (and, as always, to
Rugxulo(R), who seems to have become my virtual guardian angel, always at my shoulder at the ready to help me through the rough spots).

I ran the SET command as you advised, and that did the trick!

Thanks again to all of you on this helpful, no, I should say "indispensable," forum,

---
Will in Seattle
a.k.a. "Clueless"
Running MS-DOS 6.21

Back to the board
Thread view  Mix view  Order
15111 Postings in 1359 Threads, 247 registered users, 17 users online (0 registered, 17 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum