Jump to content

edit win.ini


Recommended Posts

ok, first i would like to say thanks for your help with this.

i need to change just a part of the win.ini on our xp systems. the problem is that a lot of users win.ini are different, so the line numbers that i need to edit are always going to be different.

example:

; for 16-bit app support

[fonts]

[extensions]

[mci extensions]

[files]

[Mail]

MAPI=1

CMC=1

CMCDLLNAME=mapi.dll

CMCDLLNAME32=mapi32.dll

MAPIX=1

MAPIXVER=1.0.0.1

OLEMessaging=1

[MCI Extensions.BAK]

aif=MPEGVideo

aifc=MPEGVideo

aiff=MPEGVideo

asf=MPEGVideo

asx=MPEGVideo

au=MPEGVideo

[CKSN]

winNT=open

the part i need to change is the [mail]

i would like to delete whatever they have and add my own entrys to everyone. is there a way to define just the [mail] part? if they have by chance a few [fonts] setting or [files] setting that changes the lines i need to edit.

thanks again everyone for all your help...

d@ve

Link to comment
Share on other sites

that was easy enough thanks for the help, sorry for the lame question...

IniDelete("C:\windows\win.ini", "mail")

IniWrite("C:\windows\win.ini", "mail", "MAPI", "1")

IniWrite("C:\windows\win.ini", "mail", "CMC", "1")

IniWrite("C:\windows\win.ini", "mail", "CMCDLLNAME", "mapi.dll")

IniWrite("C:\windows\win.ini", "mail", "CMCDLLNAME32", "mapi32.dll")

IniWrite("C:\windows\win.ini", "mail", "MAPIX", "1")

IniWrite("C:\windows\win.ini", "mail", "MAPIXVER", "1.0.0.1")

IniWrite("C:\windows\win.ini", "mail", "OLEMessaging", "1")

d@ve

Link to comment
Share on other sites

You could also use variables, which would make it easier to make changes in the future. And you don't need the IniDelete

$WinIniName = @WindowsDir & "\win.ini"
$WinIniSection = "mail"

IniWrite($WinIniName, $WinIniSection, "MAPI", "1")
IniWrite($WinIniName, $WinIniSection, "CMC", "1")
IniWrite($WinIniName, $WinIniSection, "CMCDLLNAME", "mapi.dll")
IniWrite($WinIniName, $WinIniSection, "CMCDLLNAME32", "mapi32.dll")
IniWrite($WinIniName, $WinIniSection, "MAPIX", "1")
IniWrite($WinIniName, $WinIniSection, "MAPIXVER", "1.0.0.1")
IniWrite($WinIniName, $WinIniSection, "OLEMessaging", "1")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...