找回密码
 加入
搜索
查看: 5264|回复: 6

[系统综合] AutoIt 怎么无法修改XML文件?

  [复制链接]
发表于 2011-10-22 17:52:18 | 显示全部楼层 |阅读模式
大家好, 我用AutoIt修改一个xml文件可以修改成功,但是修改另外一个xml文件却不行。 两个autoit的语句都一样,只是xml文档不一样。 请大家看一下原因, 谢谢!!!

这个是AutoIt文档!

#include <_XMLDomWrapper.au3>

Global Const $sFile = @ScriptDir & "\test.xml"

If _XMLFileOpen($sFile) = 1 Then

_XMLDeleteNode("unattend")

EndIf



这个是 我想修改但是无法修改的xml文件
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="windowsPE">
                <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <UserData>
                                <AcceptEula>true</AcceptEula>
                        </UserData>
                        <ImageInstall>
                                <OSImage>
                                        <InstallFrom>
                                                <MetaData wcm:action="add">
                                                        <Key>/IMAGE/NAME</Key>
                                                        <Value>Windows 7 ULTIMATE</Value>
                                                </MetaData>
                                        </InstallFrom>
                                        <WillShowUI>OnError</WillShowUI>
                                </OSImage>
                        </ImageInstall>
                </component>
                <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <InputLocale>en-us</InputLocale>
                        <SystemLocale>en-us</SystemLocale>
                        <UILanguage>en-us</UILanguage>
                        <UserLocale>en-us</UserLocale>
                </component>
        </settings>
        <settings pass="specialize">
                <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <ComputerName>W7</ComputerName>
                        <ShowWindowsLive>false</ShowWindowsLive>
                </component>
                <component name="Microsoft-Windows-SystemRestore-Main" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <DisableSR>1</DisableSR>
                </component>
                <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <BlockPopups>yes</BlockPopups>
                        <FilterLevel>High</FilterLevel>
                        <PlaySound>false</PlaySound>
                        <ShowInformationBar>false</ShowInformationBar>
                        <DisableAccelerators>true</DisableAccelerators>
                        <DisableDevTools>true</DisableDevTools>
                        <DisableFirstRunWizard>true</DisableFirstRunWizard>
                        <DisableOOBAccelerators>true</DisableOOBAccelerators>
                        <Home_Page>http://google.com</Home_Page>
                </component>
                <component name="Microsoft-Windows-ErrorReportingCore" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <DisableWER>1</DisableWER>
                </component>
        </settings>
        <settings pass="oobeSystem">
                <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <InputLocale>en-us</InputLocale>
                        <SystemLocale>en-us</SystemLocale>
                        <UILanguage>en-us</UILanguage>
                        <UserLocale>en-in</UserLocale>
                </component>
                <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <OOBE>
                                <HideEULAPage>true</HideEULAPage>
                                <ProtectYourPC>3</ProtectYourPC>
                                <NetworkLocation>Home</NetworkLocation>
                        </OOBE>
                        <UserAccounts>
                                <LocalAccounts>
                                        <LocalAccount wcm:action="add">
                                                <Name>radeon</Name>
                                                <Group>Administrators</Group>
                                        </LocalAccount>
                                </LocalAccounts>
                        </UserAccounts>
                        <TimeZone>India Standard Time</TimeZone>
                </component>
        </settings>
        <cpi:offlineImage cpi:source="wim:/sources/install.wim#Windows 7 ULTIMATE" xmlns:cpi="urn:schemas-microsoft-com:cpi"/>
</unattend>
这个是 _XMLDomWrapper.au3     UDF

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-10-22 21:47:45 | 显示全部楼层
搜索论坛,早段时间才看到有人提到这个XML的!
发表于 2011-10-22 22:17:46 | 显示全部楼层
我提到过读取xml文件中的某个值,但是未果,现在还是用文本打开,然后用正则提取。
发表于 2011-10-23 07:26:14 | 显示全部楼层
不明白楼主的意思,也许看看这里对你有帮助!
http://www.autoitx.com/search.ph ... mp;searchsubmit=yes
发表于 2011-10-23 21:42:33 | 显示全部楼层
学习  , 正需要
 楼主| 发表于 2011-10-28 09:06:34 | 显示全部楼层
回复 4# hzxymkb


    谢谢!
 楼主| 发表于 2011-10-28 09:07:03 | 显示全部楼层
这个链接 帮我解决了问题,大家可以看一下
http://www.autoitx.com/search.ph ... mp;searchsubmit=yes
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-20 03:26 , Processed in 0.077964 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表