I have an .ini file that contains some entries that I want deleted/modified. I need a script that can automatically modify the contents of the .ini, and its something that would eventually be implemented through a logon script. Can someone provide a script that automatically modifies the .ini file to delete/modify certain entries? The entries are:
AddInMenus=NCMenu
EXTMGR_ADDINS=NCExtMgr,nDL
OLNEMFileW
atcheru.dl
l
<Sometimes the above line will only be EXTMGR_ADDINS=
What I need is the following:
If AddInMenus=NCMenu exists then it needs to be deleted.
If EXTMGR_ADDINS=NCExtMgr,nDL
OLNEMFileW
atcheru.dl
l exists then it needs to be modified to: EXTMGR_ADDINS=nDLOLNEMFile
Watcheru.d
ll
If EXTMGR_ADDINS= exists then it needs to be deleted.
The entries are not static to any particular line, so theyre not fixed to lines 5 & 6.
Hopefully theres a script guru out there that can tackle this with ease.
Heres an example of the .ini contents:
[Notes]
KitType=1
Directory=C:\notes\data
InstallType=2
AddInMenus=NCMenu
EXTMGR_ADDINS=NCExtMgr,nDL
OLNEMFileW
atcheru.dl
l
FaultRecovery_Build=Releas
e 6.5.2
DSTLAW=3,2,1,11,1,1
UPDATE_TIMER=10/12/2005 07:53:45 PM
SUDIALOG_ON=0
Timezone=5
DST=1
MailType=0
$$HasLANPort=1
WWWDSP_SYNC_BROWSERCACHE=0
WWWDSP_PREFETCH_OBJECT=0
EnableJavaApplets=1
EnablePlugins=1
Preferences=-1744829327
AltNameLanguage=en
ContentLanguage=en-US
WeekStart=1
ViewWeekStart=2
NavWeekStart=1
XLATE_CSID=52
SPELL_LANG=1033
SPELL_PREFERENCES=0
Region=en-US
DatePickerDirection=0
Passthru_LogLevel=0
Console_LogLevel=2
VIEWIMP1=Lotus 1-2-3,0,_IWKSV,,.123,.WK1,
.WK3,.WK4,
.WKS,.WR1,
.WRK,,4,
VIEWIMP2=Structured Text,0,_ISTR,,.CGN,.LTR,.S
TR,,1,
VIEWIMP3=Tabular Text,0,_ITAB,,.PRN,.RPT,.T
AB,.TXT,,1
,
VIEWIMP4=vCard,0,_IVCRD,,.
VCF,,1,
VIEWEXP1=Comma Separated Value,0,_XCSV,,.CSV,,1,
VIEWEXP2=Lotus 1-2-3,0,_XWKS,,.123,.WK1,.
WK3,.WK4,.
WKS,.WR1,.
WRK,,4,
VIEWEXP3=Structured Text,0,_XSTR,,.CGN,.LTR,.S
TR,,1,
VIEWEXP4=Tabular Text,1,_XTAB,,.CGN,.LTR,.R
PT,.TAB,,1
,
VIEWEXP5=vCard 2.1,0,_XVCRD,,.VCF,,1,
VIEWEXP6=vCard 3.0,0,_XVCRD3,,.VCF,,1,
EDITIMP1=ASCII Text,0,_ITEXT,,.C,.H,.PRN,
.RIP,.TXT,
,1,
EDITIMP2=Binary with Text,0,_ISTRNGS,,.*,,1,
EDITIMP3=BMP Image,0,_IBMP,,.BMP,,18,
EDITIMP4=CGM Image,0,_IFL,,.CGM,.GMF,,8
,
EDITIMP5=GIF Image,0,_IGIF,,.GIF,,18,
EDITIMP6=HTML File,0,_IHTML,,.HTM,.HTML,
,1,
EDITIMP7=JPEG Image,0,_IJPEG,,.JPG,,18,
EDITIMP8=Lotus 1-2-3,0,_IW4W,_IWKSE,.123,
.WK1,.WK3,
.WK4,.WKS,
.WR1,.WRK,
,4,
EDITIMP9=Lotus PIC,0,_IPIC,,.PIC,,8,
EDITIMP10=Lotus Word Pro,0,_IW4W,,.LWP,,2,
EDITIMP11=Microsoft Excel,0,_IW4W,,.XLS,,4,
EDITIMP12=Microsoft RTF,0,_IW4W,_IRTF,.DOC,.RT
F,,2,
EDITIMP13=Microsoft Word,0,_IW4W,,.DOC,,2,
EDITIMP14=PCX Image,0,_IPCX,,.PCX,,18,
EDITIMP15=TIFF 5.0 Image,0,_ITIFF,,.TIF,,18,
EDITIMP16=WordPerfect 5.x,0,_IW4W,,.DOC,.WPD,,2,
EDITIMP17=WordPerfect 6.0/6.1,0,_IW4W,,.DOC,.WPD
,.WPT,,2,
EDITEXP1=ASCII Text,2,_XTEXT,,.C,.H,.PRN,
.RIP,.TXT,
,1,
EDITEXP2=CGM Image,2,_XCGM,,.CGM,.GMF,,
8,
EDITEXP3=Microsoft RTF,2,_XRTF,,.DOC,.RTF,,4,
EDITEXP4=TIFF 5.0 Image,2,_XTIFF,,.TIF,,18,
EDITEXP5=vCard 2.1,0,XVCRD,,.VCF,,1,
EDITEXP6=vCard 3.0,0,XVCRD3,,.VCF,,1,
DDETimeout=10
NAMEDSTYLE0=03004261736963
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0001010100
000A000000
0000000100
A0050A0000
006400A005
0A00000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0094040000
00000000
NAMEDSTYLE0_FACE=Default Sans Serif
NAMEDSTYLE1=030042756C6C65
7400000000
0000000000
0000000000
0000000000
0000000000
0000000000
0001010100
000A000000
0000000000
08070A0000
0064000807
0A00000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0494040000
00000000
NAMEDSTYLE1_FACE=Default Sans Serif
NAMEDSTYLE2=0300486561646C
696E650000
0000000000
0000000000
0000000000
0000000000
0000000000
0001010101
0B0C000000
0000000100
A0050A0000
006400A005
0A00000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0094040000
00000000
NAMEDSTYLE2_FACE=Default Sans Serif
DefaultMailTemplate=mail6.
ntf
DESKWINDOWSIZE=33 42 767 528
FileDlgDirectory=C:\Docume
nts and Settings\rmoore\Desktop
TCPIP=TCP, 0, 15, 0
LAN0=NETBIOS,0,15,0,,12288
,
SPX=NWSPX, 0, 15, 0
COM1=XPC,1,15,0,,12288,
COM2=XPC,2,15,0,
COM3=XPC,3,15,0,,12288,
COM4=XPC,4,15,0,
COM5=XPC,5,15,0,
Ports=TCPIP
DisabledPorts=LAN0,COM1,CO
M3,SPX,COM
2,COM4,COM
5
KeyFilename=rmoore.id
PhoneLog=2
Log=log.nsf, 1, 0, 7, 40000
CertificateExpChecked=rmoo
re.id 04/19/2007
MailFile=mail\rmoore.nsf
MailServer=CN=NotesMail1/O
U=SEB/O=Va
rian
TemplateSetup=600400
Setup=650200
Location=Office (Network),9DE,CN=Robert Moore/OU=IIS/OU=SEB/O=Vari
an
$IEVersionMajor=6
RequestCertTableUpdate=rmo
ore.id 04/20/2007
ECLSetup=3
DYNINFOCR_OF2C598276:E0834
6CD-ON2DB0
6065:C521F
41D=OF5BB2
D1B5:E97E7
4D4-ON6009
6882:0C6F5
CD5
$MIMESaveFormat=0
MIMEPromptMultilingual=1
CSEnblRstTm=0
DeskIconColors=0
ReplDefPartDocsLimitAmt=0
ReplDefPartAtchLimitAmt=0
ReplDefEncrypt=1
ReplDefEncryptType=2
ReplDefReplImmed=1
MIMEMultilingualMode=2
MIMETmpMultilingual=3
MailSetup=650200
MailUpgradeFolder=650200
$headlineClientId=9DFA5ECE
:9BD30ACD-
85257273:0
07306FD
DontCheckDefaultMail=1
NewMailSeqNum=2304
NewMailSeqNum852571F5:007B
126E=2304
LastHistoryPruneTime=04/20
/2007 07:56:33 AM
WindowSizeKeywords=644 517 299 275
BCASE_SITEMAP_DISPLAY=13
FINDSTRING0=Charlene
WindowMoreStateSearch=0
NAMES=names.nsf, mobiledir.nsf
ReplDefFullDocs=1
ReplDefPartDocsLimit=0
ReplDefPartAtchLimit=0
ReplDefFullText=0
$headlineDisableHeadlines=
0
PromptForLocation=0
EmptyTrash=0
UNICODE_Display=1
AltCalendar=0
QuotePrefix=>
QuoteLineLength=70
IM_ENABLE_SSO=1
EnableActiveXInBrowser=1
EnableJavaScript=1
EnableJavaScriptErrorDialo
gs=1
EnableLiveConnect=1
BackgroundPrinting=1
ShowAccelerators=1
DisableImageDithering=1
NewMailInterval=5
WINDOWSIZEWIN=108 284 1375 885
MAXIMIZED=0
SPELL_DLL=ltspln50.dll
SPELL_DIR=C:\notes\data
BuddyListVisible=0
BuddyListPos=1349 779 243 389
WindowMoreStateNewRepl=1
WindowSizeUpdateDesign=634
430 323 106
HELPWINDOWSIZEWIN=143 409 1314 761
HELPMAXIMIZED=0
WindowSizeChooseServers=63
3 517 323 305
FINDSTRING1=jared
FINDSTRING2=Corey
FINDSTRING3=beamon
$W3LocalFormSave=0
IM_DYN_GROUP_OPEN_STATE=0
FINDSTRING4=isabel
ChooseNameDlgColWidths=124
,124,124,1
24,9999,
WindowSizeAmbiguousDialog=
467 430 656 307
$DialogMode=0
WindowSizeNameSoundexMaili
ng=467 430 656 307
$EnableAlarms=1
CalendarTimeSlotStart=420
CalendarTimeSlotEnd=1140
CalendarTimeSlotDuration=6
0
WindowSizeBrowseAlarms=525
430 541 289
WindowSizeBrowseDForms=609
519 371 260
WindowSizeViewNew=574 142 451 408
$CreateBookmarkLastFolder=
Favorite Bookmarks
WindowSizeBookmark=613 142 374 309
MultiRoomDlgSize=495,1082,
516,836,
WindowSizeOpenDoc=524 517 548 297
SelectAddressesDialogSize=
501,1097,5
20,845,
NameAddressingDlgLastViewN
ame=0,List
by name
Win32InfoboxPos=2 110
WindowSizeToolbarPrefs=494
455 593 499
WindowSizePickKeywords=591
525 403 314
URLAddress1=
http://www.homelandsecurityus.com/URLAddress2=
http://hotair.com/archives/2007/04/11/todays-must-reads/URLAddress3=
http://video.google.com/videoplay?docid=-7320960375181402397&q=ferrari+vs+f1&hl=enURLAddress4=
http://www.thinkgeek.com/computing/accessories/8a0f/MultiResourceDlgSize=495,1
082,516,83
6,
SelectNamesDialogSize=491,
1087,516,8
70,
URLAddress5=\\us-vcsvss-d1
a\ConfigFi
le
WindowSizeBrowse=641 518 322 325
WindowSizeCalendarEmodal=4
95 523 608 522
URLAddress6=
http://www.penny-arcade.com/comic/2007/03/09WindowSizeReplSeverList=61
4 368 332 240
WindowSizeReplSettings=494
368 572 403
URLAddress7=
http://www.gizmag.com/go/3603/URLAddress8=
http://www.welectronics.com/Bluetooth/SONYERICSSON_HBH-300.htmlURLAddress9=
http://www.gsmarena.com/blackberry_pearl_8100-1701.phpAutoFadeIMContactList=50
URLAddress10=
http://www.gamespot.com/games.html?type=bc&platform=1029&page_type=games&tag=subnav;xbox_compat