Jump to content
raji

How to modify the config fle using autoit

Recommended Posts

raji

hi,

Im new to Autoit scripting.I want to modify the config file & i tried the below code 



#include<_XMLDomWrapper.au3>
 

$Filename=@scriptdir & "\Web.config"
$oxml=ObjCreate("Microsoft.XMLDOM")
$oxml.load($Filename &     @CRLF)


$okey=$oxml.selectSinglenode("//add[@key='ReqPerCode']")
ConsoleWrite($okey & @CRLF)
$okey.setAttribute("Value","True")
ConsoleWrite($okey & @CRLF)

 

My config:

<add key="DualOperator" value="False" />
    <add key="ReqPerCode" value="False" />

 

while running this script "D:\AutoItScripts\changekeyvalue.au3"(4,9) : error: can't open include file "_XMLDomWrapper.au3"." this error is thrown.

 

 

 

Share this post


Link to post
Share on other sites
Jos

Did you make that file available in the script dir as that isn't a standard UDF library?

Jos

ps..  why are you adding  @CRLF at the end of the filename?

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
raji

 

I  got this code while searching for my requirement ,i just used that .

Share this post


Link to post
Share on other sites
Jos

That's fine, but you need to get that file that contains these UDF's as they are  not standard, so I suggest you do a search for it on the forum.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.