Solved

Need to change a .inf file entry

Posted on 2011-03-20
6
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 12

Expert Comment

by:prashanthd
ID: 35175888
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
ID: 35175918
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
ID: 35175979
I want
autoproxy="http://testing
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Accepted Solution

by:
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"
0
 

Author Comment

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

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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