General discussion

Locked

Removing specific string in autoexec.bat

By Dennis London ·
I am trying to find a way to remotely edit approximately 5000 Win9X machines. What I need to do is REMARK (REM out) one particular string that could be located anywhere in the autoexec.bat. Does anyone have any idea of how this can be done? Java script or any other type of script? Or better yet has anyone done it? I really don't want to have to visit all these machines or do individual remote sessions for each machine.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Removing specific string in autoexec.bat

by Maelgwyn In reply to Removing specific string ...

It is possible to do this:

Make a new Autoexec.bat file and sit it on the authentication server.

When each user logs in, make a script that copies the file across the connection, so then the new file is propagated onto each machine almost automatically.

Ok, this may help you, but it also may not, especially if there is different autoexec.bat files across the whole board, then you may need to do some remote access to any non standard file(s)

Hope it helps

Maelgwyn

Collapse -

Removing specific string in autoexec.bat

by Dennis London In reply to Removing specific string ...

Thanks for the answer but with over 5K Win9X machines you know as well as I do that only about 100 (if I'm lucky) are anywhere near COE standards. They're all going to have some sort of slight variation to them.

Collapse -

Removing specific string in autoexec.bat

by Joseph Moore In reply to Removing specific string ...

I had a similar problem, trying to update over 100 HOSTS files. I had to remove a single line in them, so I used the FIND command. I copied the HOSTS file to a shared folder (calling the copy of the file the computer name it came from using the %computername% variable), then I ran the following:

FIND /V /I "Text To Remove" \\SERVER1\SHARE1\%computername%.txt> \\SERVER1\SHARE1\%COMPUTERNAME%2.TXT

That searched throughout the entire file, looking for everything EXCEPT the text string I wanted to remove; it then made a NEW file that was exactly like the old HOSTS file, EXCEPT the line I wanted removed was NOT in there.

I then just replaced the old HOSTS file with my new copy.

I can send you the whole BAT file script if you like asan example. You can change it to fit your needs.

hope this helps

Collapse -

Removing specific string in autoexec.bat

by Joseph Moore In reply to Removing specific string ...

Just have this file run in each user's logon script, and there you go!

Collapse -

Removing specific string in autoexec.bat

by Dennis London In reply to Removing specific string ...

Tried it and it worked on almost twenty machines. Thanks but I still need something that will actually search through the autoexec.bat file instead of replacing what's already there.

Collapse -

Removing specific string in autoexec.bat

by JackOfAllTech In reply to Removing specific string ...

Get a copy of KixScript from www.kixtart.org


Ralph

Collapse -

Removing specific string in autoexec.bat

by Dennis London In reply to Removing specific string ...

Tried this as well and noticed that this doesn't search the autoexec.bat either. Good idea but not what I need.

Collapse -

Removing specific string in autoexec.bat

by Dennis London In reply to Removing specific string ...

Point value changed by question poster. I need something that will "search" through the autoexec.bat file and automatically REM out or replace specified string.

Collapse -

by Dennis London In reply to Removing specific string ...

This question was closed by the author

Back to Windows Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums