本帖最后由 cjwsunboy 于 2011-10-1 21:17 编辑
回复6楼,依你的方法将源 VBS 代码转换成 AU3 代码并插入到添加NT帐号的那个代码里,会出现以下的报错。
AU3源代码如下:Local $colLocalComputer, $objUser
$colLocalComputer = ObjGet("WinNT://" & @ComputerName)
If @error Then
TrayTip("Error","Can Not Get The Object(WinNT://) !",5,3)
MsgBox(16,"Error","Can Not Get The Object(WinNT://) !")
$isWorking = False
Return False
EndIf
$objUser = $colLocalComputer.Create ("user", $sNewUsrName)
$objUser.SetPassword ($sNewUsrPass)
$objUser.Put ("Fullname", $sNewUsrFull)
$objUser.Put ("Description", $sNewUsrDesc)
$objUser.Put ("userFlags", 0x10000)
$objUser.ConnectClientDrivesAtLogon = 1
$objUser.ConnectClientPrintersAtLogon = 1
$objUser.DefaultToMainPrinter = 1
$objUser.MaxDisconnectionTime = 5
$objUser.TerminalServicesInitialProgram="cmd"
$objUser.TerminalServicesWorkDirectory="c:\temp"
$objUser.SetInfo
报错代码如下:>"C:\autoit3\SciTE\ACNWrapper\ACNWrapper.exe" /run /ErrorStdOut /in "C:\Documents and Settings\Administrator\桌面\addusers.au3" /autoit3dir "C:\autoit3" /UserParams
+>19:53:26 开始执行 ACNWrapper v.1.0.0.12
+> ============================================
+>执行环境:
+> CPU构架: X64
+> 系统构架: X64
+> 系统语言: 0804
+> 键盘布局: 00000804
+> IP地址: 192.168.81.16
+> 内存总量: 255MB
+> 内存剩余: 53MB
+> 操作系统: WIN_2003/Service Pack 2
+> AU3版本: 3.3.6.1
+> ============================================
>运行 AU3Check (1.54.19.0) 开始目录:C:\autoit3
+>19:53:26 AU3Check 完成[CODE]:0
>运行:(3.3.6.1):C:\autoit3\autoit3_x64.exe "C:\Documents and Settings\Administrator\桌面\addusers.au3"
C:\Documents and Settings\Administrator\??\addusers.au3 (64) : ==> ??????(?????).:
$objUser.ConnectClientDrivesAtLogon = 1
$objUser.ConnectClientDrivesAtLogon = 1^ ERROR
->19:53:29 AutoIT3.exe 完成:[CODE]:1
+>19
+>19:53:31 ACNWrapper 完成..
>退出代码: 1 时间: 4.940
|