Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

WIN.INI file Mods.

Hi Folks,

I need some advice/techniques on doing a search & replace

on a win.ini file.

Basicly,were changing the name of the netware file server,

and all the client have persistent drive mappings to the old

server name in their win3.1x win.ini files


So i want to create a qbasic program, that I can put into the

autoexec.bat that will change the relevant section in win ini (see snip)


Using sequential file i/o dosn't work, because it ignores

formmating characters. And I'm a bit stuck on Binary mode (I think that's the way forward)




[Network]

LPT1:=\MKBISFS1BIS1LAS5

LPT2:=\MKBISFS1BIS1QMS1


Basicly I want to replace just MKBISFS1 with NEWSERVER1 etc


Many thanks

Eliot.


Comments

  • Personally, I would use Line Input. Get all the lines into an array and search through them. Get a line from the array and see if it matches the heading ([Network])for that particular section. If it does, then you have the right section. You can now search for the line in the section that starts with "LPT1:" and change it. Once you have the correct line changed, close the file and re-open it for output. Write the entire array back to the file, close it and you're done.


  • : Personally, I would use Line Input. Get all the lines into an array and search through them. Get a line from the array and see if it matches the heading ([Network])for that particular section. If it does, then you have the right section. You can now search for the line in the section that starts with "LPT1:" and change it. Once you have the correct line changed, close the file and re-open it for output. Write the entire array back to the file, close it and you're done.





Sign In or Register to comment.