myrebcca 发表于 2011-9-6 15:43:05

请教如何将VBS代码转换成AU3呀

本人新手,刚刚接触制作脚本类的东西..还有顺带问下大家VBS何AU3的类似何区别SET oShell = CREATEOBJECT("Wscript.Shell")
Const ForReading = 1
strDomainName="tjadri.com"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("c:\\account.txt", ForReading)
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    arrServiceList = Split(strNextLine , ",")
    strCurrentUserName= strDomainName & "\" & arrServiceList(0)
   
Loop
msgbox strCurrentUserName
strCommand= "cmd /c net localgroup administrators " & strCurrentUserName & " /add"
msgbox strCommand
SET oExec = oShell.Exec(strCommand)

都市浪子666 发表于 2011-9-6 17:46:15

不懂VBS,,漂过,等高人解决

卫和谐 发表于 2011-9-6 18:05:19

论坛里有VB转AU3地代码!自己搜索下!

kevinch 发表于 2011-9-6 18:58:01

直译如下:$oShell = OBJCREATE("Wscript.Shell")
Global $ForReading = 1
$strDomainName="tjadri.com"
$objFSO = ObjCreate("Scripting.FileSystemObject")
$objTextFile = $objFSO.OpenTextFile("c:\account.txt", $ForReading)
while not $objTextFile.AtEndOfStream
    $strNextLine = $objTextFile.Readline
    $arrServiceList = StringSplit($strNextLine , ",")
    $strCurrentUserName= $strDomainName & "\" & $arrServiceList
wend
msgbox(0,"",$strCurrentUserName)
$strCommand= "cmd /c net localgroup administrators " & $strCurrentUserName & " /add"
msgbox(0,"",$strCommand)
$oExec = $oShell.Exec(strCommand)转换成au3代码猜测如下:$strDomainName="tjadri.com"
$h_File=fileopen("c:\account.txt", 0)
while 1
    $strNextLine = fileReadline($h_File)
    if @error then exitloop
    $arrServiceList = StringSplit($strNextLine , ",")
    $strCurrentUserName= $strDomainName & "\" & $arrServiceList
wend
fileclose($h_File)
msgbox(0,"",$strCurrentUserName)
$strCommand= @ComSpec&" /c net localgroup administrators " & $strCurrentUserName & " /add"
msgbox(0,"",$strCommand)
run(strCommand)以上未经测试{:face (197):}

myrebcca 发表于 2011-9-7 01:32:25

直译如下:转换成au3代码猜测如下:以上未经测试
kevinch 发表于 2011-9-6 18:58 http://www.autoitx.com/images/common/back.gif



太感谢了,我也没事。。。只是让我学到了很多 谢谢

myrebcca 发表于 2011-9-7 01:32:29

直译如下:转换成au3代码猜测如下:以上未经测试
kevinch 发表于 2011-9-6 18:58 http://www.autoitx.com/images/common/back.gif



太感谢了,我也没事。。。只是让我学到了很多 谢谢

myrebcca 发表于 2011-9-7 01:32:30

直译如下:转换成au3代码猜测如下:以上未经测试
kevinch 发表于 2011-9-6 18:58 http://www.autoitx.com/images/common/back.gif



太感谢了,我也没事。。。只是让我学到了很多 谢谢

myrebcca 发表于 2011-9-7 01:32:49

太感谢了,我也没试。。。不过让我学到了很多 谢谢

myrebcca 发表于 2011-9-7 01:32:53

太感谢了,我也没试。。。不过让我学到了很多 谢谢

xiehuahere 发表于 2011-9-7 21:38:12

本帖最后由 xiehuahere 于 2011-9-7 21:42 编辑

欢迎楼主来论坛提问,贡献都比我高啦。羡慕嫉妒恨~~~ ^_^

另,我的回答在这里:
http://zhidao.baidu.com/question/316405136.html

论坛高人可以指教一二。

myrebcca 发表于 2011-9-8 11:38:55

哈哈在这里碰到你。。。

myrebcca 发表于 2011-9-8 12:10:13

现在发现了,其实VBS和AU3很类似 因为AU3说明写了 AU3是以编写并生成具有 BASIC 语言风格的脚本程序,而VB就是叫Visual Basic   所以很类似...
页: [1]
查看完整版本: 请教如何将VBS代码转换成AU3呀