#include <Process.au3>
$bat = FileOpen(@WindowsDir & "\temp\test.bat", 2)
FileWriteLine($bat, "@echo off")
FileWriteLine($bat, "rem 把计算机加到域并收回本地管理员密码")
FileWriteLine($bat, "rem")
FileWriteLine($bat, "pause")
FileWriteLine($bat, "netdom join %computername% /domain:cngzdc /userd:panbihai /passwordd:zh@12345")
FileWriteLine($bat, "net localgroup administrators cngzdc\panbihai /add")
FileWriteLine($bat, "net user administrator zh12345678")
FileWriteLine($bat, "@echo %computername%")
FileWriteLine($bat, "@echo 加入完成,重启之后请用域用户登录,准备重启.")
FileClose($bat)
RunWait(@ComSpec & " /c call %widir%\temp\test.bat", @ScriptDir, @SW_HIDE)
RunWait(@ComSpec & " /c del /s /q %widir%\temp\test.bat", "", @SW_HIDE)
随便弄了下 不知是否是楼主想要的效果 |