一共有三个脚本。第一个是改计算机名然后重启。第二个是加域和加用户账号到本地管理员组。第三个是删除痕迹和重启 这里计算机名的命名方法是:cis+ domainaccount+00 (site 简写+用户账号+用户第几台计算机,可以根据需要调整计算机名 你只需要运行第一个脚本 changename.vbs 然后会弹出一个窗口叫你输入计算机名。余下的就有脚本帮你完成了。 changename.vbs '************************************************************************************************************** 'Description: Change computer name reboot the system and auto login system with administrator ' 'author: Bo.zhang@lsi.com 'time : 08/30/2010 ' '************************************************************************************************************** 'Option Explicit 'On Error Resume Next Const HKEY_LOCAL_MACHINE = &H80000002 Dim strComputer Dim newComputerName Dim strKeyPath Dim strKeyPathTCPIP Dim objReg Dim objSysInfo 'Dim computerPath 'Dim arrDirectoryLocation() 'Dim i 'Dim strLocation 'Dim ouPath strComputer = "." strKeyPath = "SYSTEM\CurrentControlSet\Control\ComputerName\" strKeyPathTCPIP = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\" Set objReg = GetObject("WinMgmts:{impersonationLevel=Impersonate}!\\" & _ strComputer &"\root\default:StdRegProv") Set ShellObj = WScript.CreateObject("WScript.Shell") '*****************************************************make the script run one when system start ShellObj.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\addtodomain", "c:\windows\addtodomain.vbs" Set FSO = WScript.CreateObject("Scripting.FilesystemObject") '****************************** copy files to local FSO.CopyFile "addtodomain.vbs", "c:\windows\addtodomain.vbs" Set NetObj = WScript.CreateObject("WScript.Network") WinDir = FSO.GetSpecialFolder(0) SysDir = FSO.GetSpecialFolder(1) On Error Resume Next WinPass="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT...