Solved

Need to change a .inf file entry

Posted on 2011-03-20
6
400 Views
Last Modified: 2012-05-11
I need to change a entry in file. So looking to create a script.

I have created a script, which work fine it is as below:

Dim oFS    : Set oFS = CreateObject( "Scripting.FileSystemObject" )
Dim sFSpec : sFSpec  = "C:\1\ie7uinit.inf"
Dim sFnd   : sFnd    = "autoproxy="
Dim sRpl   : sRpl    = "autoproxy=http://testing"

Dim sText
' read
sText= oFS.OpenTextFile( sFSpec ).ReadAll


' change
sText = Replace( sText, sFnd, sRpl )


' save
oFS.CreateTextFile( sFSpec, True ).Write sText

msgbox "done"

Set oFS = Nothing

Wscript.quit

Set oFS = Nothing

Wscript.quit


The above script is making changes in file saved in c:\1\ie7unit.inf
However in ie7unit.inf there is an entry as below:

cachelimit=00005000
autoproxy="http://proxy.address

Prob is there is double quotes in start of autoproxy, so when i change my script & add " it doesnt work since it understand as paramater.
Please assist.
0
Comment
Question by:yagnesh_123
  • 4
  • 2
6 Comments
 
LVL 12

Expert Comment

by:prashanthd
Comment Utility
You can try replacing with chr(34) where double quotes are required...

Example chr(34)&"autoproxy="&chr(34)

0
 
LVL 12

Expert Comment

by:prashanthd
Comment Utility
This is the entry in .inf file
autoproxy="http://proxy.address

What should be the replacement for above string?
0
 

Author Comment

by:yagnesh_123
Comment Utility
I want
autoproxy="http://testing
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Accepted Solution

by:
prashanthd earned 250 total points
Comment Utility
Try with the following changes

Dim sFnd   : sFnd    = "autoproxy="&Chr(34)&"http://proxy.address"
Dim sRpl   : sRpl    = "autoproxy="&Chr(34)&"http://testing"
0
 

Author Comment

by:yagnesh_123
Comment Utility
Good Man it wourked out  :)
Would like to know Chr(34) stands for double quotes?
0
 
LVL 12

Expert Comment

by:prashanthd
Comment Utility
Yes..chr(34) stands for a double quote
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now