Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need to change a .inf file entry

Posted on 2011-03-20
6
Medium Priority
?
411 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
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Integration Management Part 2
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

926 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