Computing.Net > Forums > Disk Operating System > edit autoexec from batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

edit autoexec from batch file

Reply to Message Icon

Name: CD
Date: April 6, 2001 at 11:38:20 Pacific
Comment:

I have Win95 machines that won't boot after installing a certain software because the installation places a PATH command in the autoexec without referencing the previous paths. Can anyone tell me what I need to do to place another path command in the autoexec from a batch file?

Thanks,



Sponsored Link
Ads by Google

Response Number 1
Name: Michael
Date: April 6, 2001 at 11:57:06 Pacific
Reply:

The easiest way to do it is to write a batch file like this:

echo set path=%path%;c:\newpath >> autoexec.bat

That's it! Note that it should be written out on a single line. Also note that it must be run after autoexec.bat, but that shouldn't matter because chances are that will always be the case anyway.

What it does is append a line to end of autoexec.bat that takes the current path and appends c:\newpath (You obviously should set this to what you want the additional path to be in your particular case).

Also note that this batch should be a one shot deal as it will append a line to the end of autoexec.bat every time it is run.

Now that I think about it just combine all the paths in your autoexec.bat. You shouldn't need a batch file at all (If I'm understanding you correctly).

So if your autoexec.bat reads:

set path=c:\dos
.
.
.
set path=c:\duke3d

what you want to do is combine them into a single line, I.E.

set path=c:\dos;c:\duke3d

Seperate each different directory with a semicolon and you should be good to go.

Hope that helps,
-Michael


0

Response Number 2
Name: CD
Date: April 6, 2001 at 12:15:59 Pacific
Reply:

Sorry about the two posts, I went to go back and look at it the first time and got a message saying there was no post, so I made a new one.

I tried your first suggestion (just from the command prompt) and it didn't seem to do anything to the autoexec... was there supposed to be something new in there.

I am installing this software on multiple machines (the company that wrote the software probably didn't test it on Win95 machines before release). Now, instead of going in and manually editing all the autoexec's, I want to finish installing the software, run the batch file, and reboot.

The autoexec as the install leaves it:

PATH=c:\foldername

The autoexec as I want it to look:

Path=c:\foldername
Path=%path%\c:\windows;c:\windows\command

or

Path=%path%;c:\folde


0

Response Number 3
Name: Secret_Doom
Date: April 6, 2001 at 12:37:39 Pacific
Reply:

for doing that, simply put what michael said on a batch file.
ie:

:setinput.bat
@echo SET PATH=%path%;C:\WINDOWS;C:\WINDOWS\COMMAND >> autoexec.bat

That should add the line "SET PATH=%path%;C:\WINDOWS;C:\WINDOWS\COMMAND" to the end of autoexec.bat

NOTE: BE CAREFUL!!. There are TWO ">" simbols. If you add only one, you'll really mess up the computer.

email:secret_doom@hotmail.com


0

Response Number 4
Name: Secret_Doom
Date: April 6, 2001 at 12:46:36 Pacific
Reply:

Forgot to say, all that text in the batch file (begginig with "@echo" and ending with "autoexec.bat" is in the very same line!!!!!!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: edit autoexec from batch file

edit autoexec from batch www.computing.net/answers/dos/edit-autoexec-from-batch/6413.html

Protecting batch file? www.computing.net/answers/dos/protecting-batch-file/5894.html

MS Access query from batch file www.computing.net/answers/dos/ms-access-query-from-batch-file/2567.html