?
Solved

Need to change a .inf file entry

Posted on 2011-03-20
6
Medium Priority
?
409 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
Industry Leaders: 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 1000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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