VOGONS


First post, by bf_bullpup

User metadata
Rank Newbie
Rank
Newbie

Hello everyone! Happy New Year. I just finished installing and setting up MS-DOS 6.22 in my triple boot retro computer. As a relatively new DOS user (I grew up on Macs), I just learned how to use autoexec.bat to launch a file required to enable my Sound Blaster card.

The last two lines are:
CD LIVEDOS
LIVEINIT.BAT

This causes DOS, upon start-up, to go one level down to \LIVEDOS\ and run LIVEINIT.BAT.

This may be a novice question, but after the BAT file is run up startup, I start at C:\LIVEDOS\. I would like to start at the root C:\ directory after the BAT file is run, just so I won't have to enter CD .. every time. I tried entering as the last line:
CD ..
and also
CD\

Thank you for any insight! I am sure it is something simple.

Last edited by bf_bullpup on 2024-01-01, 21:47. Edited 1 time in total.

Reply 4 of 23, by wbahnassi

User metadata
Rank Member
Rank
Member

No. What's hapenning is that he's diverting execution to LIVEINIT.BAT, so once that batch file is done, execution won't return to Autoexec. All commands after LIVEINIT.BAT will be skipped.
Only CALL LIVEINIT.BAT can fix this and allow return of execution to Autoexec after Liveinit is done.

Reply 5 of 23, by bf_bullpup

User metadata
Rank Newbie
Rank
Newbie
ldeveraux wrote on 2024-01-02, 17:00:

Conversely you could have appended CD\ to the last line in liveinit.bat

wbahnassi wrote on 2024-01-02, 17:15:

No. What's hapenning is that he's diverting execution to LIVEINIT.BAT, so once that batch file is done, execution won't return to Autoexec. All commands after LIVEINIT.BAT will be skipped.
Only CALL LIVEINIT.BAT can fix this and allow return of execution to Autoexec after Liveinit is done.

wbahnassi is correct. I tried CD\ at the last line before posting here and it did not work for me, either. Thank you both!

Reply 6 of 23, by ldeveraux

User metadata
Rank Member
Rank
Member
bf_bullpup wrote on 2024-01-02, 17:25:
ldeveraux wrote on 2024-01-02, 17:00:

Conversely you could have appended CD\ to the last line in liveinit.bat

wbahnassi wrote on 2024-01-02, 17:15:

No. What's hapenning is that he's diverting execution to LIVEINIT.BAT, so once that batch file is done, execution won't return to Autoexec. All commands after LIVEINIT.BAT will be skipped.
Only CALL LIVEINIT.BAT can fix this and allow return of execution to Autoexec after Liveinit is done.

wbahnassi is correct. I tried CD\ at the last line before posting here and it did not work for me, either. Thank you both!

you added CD\ to autoexec.bat or to liveinit.bat?

Reply 7 of 23, by CoffeeOne

User metadata
Rank Oldbie
Rank
Oldbie
bf_bullpup wrote on 2024-01-01, 21:46:
So: CD LIVEDOS CALL LIVEINIT.BAT CD .. […]
Show full quote

So:
CD LIVEDOS
CALL LIVEINIT.BAT
CD ..

That worked. Thank you very much!!!

Just a minor comment.
Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required).
So you would write
CALL C:\LIVEDOS\LIVEINIT.BAT
without the other 2 cd commands

Reply 8 of 23, by konc

User metadata
Rank l33t
Rank
l33t
CoffeeOne wrote on 2024-01-03, 13:33:
Just a minor comment. Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really require […]
Show full quote
bf_bullpup wrote on 2024-01-01, 21:46:
So: CD LIVEDOS CALL LIVEINIT.BAT CD .. […]
Show full quote

So:
CD LIVEDOS
CALL LIVEINIT.BAT
CD ..

That worked. Thank you very much!!!

Just a minor comment.
Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required).
So you would write
CALL C:\LIVEDOS\LIVEINIT.BAT
without the other 2 cd commands

I was about to write exactly this, we usually call specifying the full path instead of CDing.
A minor detail using this approach with .BAT files is that you need to know what the called .BAT does, in case it refers to another file from current path.

Reply 10 of 23, by chinny22

User metadata
Rank l33t++
Rank
l33t++
ldeveraux wrote on 2024-01-04, 17:44:

You're arguing best practice on a 30 year old dead OS? I guess?

why not?
OP is already showing an interest in playing around with dos configuration, most people would simply copy the lines out of LIVEINIT.BAT into autoexec.bat.
No harm in teaching him the "correct" way to do things.

Reply 11 of 23, by wbahnassi

User metadata
Rank Member
Rank
Member
CoffeeOne wrote on 2024-01-03, 13:33:
Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required). So you would write […]
Show full quote

Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required).
So you would write
CALL C:\LIVEDOS\LIVEINIT.BAT
without the other 2 cd commands

I don't know about LIVEINIT.BAT specifically, but the YMF7x4 DOS driver REQUIRES the presence of DOS4GW.EXE in the current directory when you're loading its drivers. If your current dir is C: (standard during Autoexec), the drivers will fail to load unless you place DOS4GW.EXE on C: root. I prefer to keep DOS4GW in the same folder as the Yamaha drivers, and do a CD in Autoexec to load the drivers then CD back to C:

Reply 12 of 23, by bf_bullpup

User metadata
Rank Newbie
Rank
Newbie
wbahnassi wrote on 2024-01-05, 03:40:
CoffeeOne wrote on 2024-01-03, 13:33:
Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required). So you would write […]
Show full quote

Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required).
So you would write
CALL C:\LIVEDOS\LIVEINIT.BAT
without the other 2 cd commands

I don't know about LIVEINIT.BAT specifically, but the YMF7x4 DOS driver REQUIRES the presence of DOS4GW.EXE in the current directory when you're loading its drivers. If your current dir is C: (standard during Autoexec), the drivers will fail to load unless you place DOS4GW.EXE on C: root. I prefer to keep DOS4GW in the same folder as the Yamaha drivers, and do a CD in Autoexec to load the drivers then CD back to C:

Thank you everyone for your enthusiasm. I knew I would be among experts posting here in VOGONS.

CoffeeOne wrote on 2024-01-03, 13:33:
Just a minor comment. Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really require […]
Show full quote

Just a minor comment.
Usually in batch files (autoexec.bat is one) you want to avoid cd commands (unless they are really required).
So you would write
CALL C:\LIVEDOS\LIVEINIT.BAT
without the other 2 cd commands

I tried the command without the two CD lines and received this message upon startup:
C:\>CALL C:\LIVEDOS\LIVEINIT.BAT
Bad command or file name

I re-inserted the two CDs and Sound Blaster loaded correctly without the error message. I did try using Call only having it being at the very first line of AutoExec.bat, but still got the same error. I have commands to start up my Gravis controller and SmartDrive as well. I guess it is what wbahnassi said, that some drivers will simply fail without CD or being put in the root directory.

Reply 13 of 23, by Disruptor

User metadata
Rank Oldbie
Rank
Oldbie

You cannot use CALL from the DOS prompt.
It is just for use within .BAT batch files.

Just leave the "CALL" away when you run a .BAT batch file directly from DOS prompt.

Can you show the contents with
TYPE C:\LIVEDOS\LIVEINIT.BAT

Reply 15 of 23, by ldeveraux

User metadata
Rank Member
Rank
Member
Azarien wrote on 2024-01-05, 09:48:
ldeveraux wrote on 2024-01-04, 17:44:

You're arguing best practice on a 30 year old dead OS? I guess?

The same is still true in Windows 10 and 11 though.

Are you suggesting Windows 10 and 11 have been both released for 30 years and killed off?

Reply 16 of 23, by CoffeeOne

User metadata
Rank Oldbie
Rank
Oldbie
ldeveraux wrote on 2024-01-05, 13:46:
Azarien wrote on 2024-01-05, 09:48:
ldeveraux wrote on 2024-01-04, 17:44:

You're arguing best practice on a 30 year old dead OS? I guess?

The same is still true in Windows 10 and 11 though.

Are you suggesting Windows 10 and 11 have been both released for 30 years and killed off?

I think he means in Windows 10 and Windows 11 you still can write batch files.
There is still the possibilty to call sub-routines with a "CALL" command.

Reply 17 of 23, by analog_programmer

User metadata
Rank Oldbie
Rank
Oldbie
ldeveraux wrote on 2024-01-05, 13:46:

Are you suggesting Windows 10 and 11 have been both released for 30 years and killed off?

What if I've never used and will never use Win8/10/11/12..., but I'm still using DOS (Free DOS is alive and supported!)? Are these latest windows versions dead or they're dead just for me? DOS lives.

from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"