
CODE: [Copy to clipboard]测试环境:cmd @ xp sp2for /f "delims=," %a in ('getmac /nh /FO csv') do @set mac=%a&call set mac=%mac:-=% &wmic computersystem where "name='%computername%'" call rename %mac% >nul
CODE: [Copy to clipboard]获取MAC地址,修改计算机名,自己写吧Set mc=GetObject("winmgmts:\\"&"."&"\root\cimv2").InstancesOf("Win32_NetworkAdapterConfiguration")
For each mac In mc
If mac.IPEnabled=True Then
mac=mac.MACAddress
Exit For
End If
Next
mac=Replace(mac,":","")
MsgBox mac
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |