Need to change a .inf file entry

Posted on 2011-03-20
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


Set oFS = Nothing


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


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.
Question by:yagnesh_123
  • 4
  • 2
LVL 12

Expert Comment

ID: 35175888
You can try replacing with chr(34) where double quotes are required...

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

LVL 12

Expert Comment

ID: 35175918
This is the entry in .inf file

What should be the replacement for above string?

Author Comment

ID: 35175979
I want
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

LVL 12

Accepted Solution

prashanthd earned 250 total points
ID: 35176004
Try with the following changes

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

Author Comment

ID: 35176023
Good Man it wourked out  :)
Would like to know Chr(34) stands for double quotes?
LVL 12

Expert Comment

ID: 35176032
Yes..chr(34) stands for a double quote

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 62
problems with mysql ODBC Connector and vbscript 4 31
VBSScript Error IP Array 6 23
VB Script: split files based a intlines flag 27 47
This is an addendum to the following article: Acitve Directory based Outlook Signature ( The script is fine, and works in normal client-server domains…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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