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

以下这段vbs文件如何转换成au3文件,谢谢!

[复制链接]
发表于 2009-10-27 13:45:49 | 显示全部楼层 |阅读模式
以下这段vbs文件如何转换成au3文件,谢谢!
Set Isa = CreateObject("FPC.Root")

Set CurArray = Isa.GetContainingArray

Set RuleElements = CurArray.RuleElements

Set DomainNameSets = RuleElements.DomainNameSets

Set DomainNameSet = DomainNameSets.Item("Domains")

Set FileSys = CreateObject("Scripting.FileSystemObject")

Set DomainsFile = FileSys.OpenTextFile("domains.txt", 1)

For i = 1 to DomainNameSet.Count

DomainNameSet.Remove 1

Next

Do While DomainsFile.AtEndOfStream <> True

DomainNameSet.Add DomainsFile.ReadLine

Loop

WScript.Echo "Saving..."

CurArray.Save

WScript.Echo "Done"
发表于 2009-10-27 21:23:12 | 显示全部楼层
突然发现 不知道哪个版本开始 vbs2au3 没有了  2au3系列都没了?

下个老版本吧 里面有
要不就学会vbs 手动转了
发表于 2009-10-27 21:57:57 | 显示全部楼层
不知是不是这样(没试):
$Isa = ObjCreate("FPC.Root") 
$CurArray = $Isa.GetContainingArray 
$RuleElements = $CurArray.RuleElements 
$DomainNameSets = $RuleElements.DomainNameSets 
$DomainNameSet = $DomainNameSets.Item("Domains") 
$FileSys = ObjCreate("Scripting.FileSystemObject") 
$DomainsFile = $FileSys.OpenTextFile("domains.txt", 1) 

For $i = 1 to $DomainNameSet.Count 
$DomainNameSet.Remove 1 
Next 

While 1
$DomainNameSet.Add $DomainsFile.ReadLine 
If $DomainsFile.AtEndOfStream = True Then ExitLoop
Wend

$CurArray.Save 
 楼主| 发表于 2009-10-28 11:13:54 | 显示全部楼层
会出错的,可否再帮我改一下,我对vbs 不熟悉
发表于 2009-10-28 11:47:31 | 显示全部楼层
   Local $vbs
   $vbs &= 'Function Domains()' & @CRLF
   $vbs &= 'Set Isa = CreateObject("FPC.Root")' & @CRLF
   $vbs &= 'Set CurArray = Isa.GetContainingArray' & @CRLF
   $vbs &= 'Set RuleElements = CurArray.RuleElements' & @CRLF
   $vbs &= 'Set DomainNameSets = RuleElements.DomainNameSets' & @CRLF
   $vbs &= 'Set DomainNameSet = DomainNameSets.Item("Domains")' & @CRLF
   $vbs &= 'Set FileSys = CreateObject("Scripting.FileSystemObject")' & @CRLF
   $vbs &= 'Set DomainsFile = FileSys.OpenTextFile("domains.txt", 1)' & @CRLF
   $vbs &= 'For i = 1 to DomainNameSet.Count' & @CRLF
   $vbs &= 'DomainNameSet.Remove 1' & @CRLF
   $vbs &= 'Next' & @CRLF
   $vbs &= 'Do While DomainsFile.AtEndOfStream <> True' & @CRLF
   $vbs &= 'DomainNameSet.Add DomainsFile.ReadLine' & @CRLF
   $vbs &= 'Loop' & @CRLF
   $vbs &= 'WScript.Echo "Saving..."' & @CRLF
   $vbs &= 'CurArray.Save' & @CRLF
   $vbs &= 'WScript.Echo "Done"' & @CRLF
   $vbs &= 'End Function' & @CRLF
   $nVBS = ObjCreate("ScriptControl")
   $nVBS.language = "VBScript"
   $nVBS.addcode($vbs)
   $nDomains = $nVBS.Run("Domains")
发表于 2009-10-28 21:14:12 | 显示全部楼层
嗯 不想转的话 就用ScriptControl对象来直接运行vbs吧
发表于 2009-11-2 17:21:45 | 显示全部楼层
上面那个是实现什么功能 的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-16 09:25 , Processed in 0.099846 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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