VBS脚本主体

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS","WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
    WScript.Echo objItem.SerialNumber
Next

set adapters = getobject("winmgmts:\\.\root\CIMV2:Win32_NetworkAdapterConfiguration")
for each card in adapters.instances_
    if not isnull(card.macaddress) then
       wscript.echo card.macaddress
    end if
next

WScript.Echo

Set userAd=GetObject("WinNT://avalon-xp/administrator,user")
userAd.accountdisabled=true
userAd.setpassword "123456"
userAd.setinfo

Set user1 =GetObject("WinNT://avalon-xp/user,user")
user1.accountdisabled=False
user1.setinfo


Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.run("cmd /k diskpart.exe /s c:\djy\Createdisk.txt")

Createdisk.txt文件内容,是用diskpart磁盘分区的信息
select volume=0
remove
assign letter=G
select disk 1
clean
create partition primary size=2000
format quick
select volume 2
assign
create partition primary size=1000
format quick
select volume 3
assign
create partition primary
format quick
select volume 4
assign

非常好的参考链接: