小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

分享vbs腳本辦事的樂趣

 xiezuoru 2006-06-12
今天偶然發(fā)現(xiàn)金庸網(wǎng)游的文件夾下的cur和ani格式的圖標(biāo)文件都不錯(cuò),于是把它們復(fù)制到C:\ye下,按照我的習(xí)慣,我會(huì)把文件名改名為1.cur,2.ani這樣的寫法,于是想起來vbs腳本. 可以存放于任意目錄下.
------aa.vbs--------

程序代碼 程序代碼
dim fso,yexj00,s
s=0
set fso=createobject("Scripting.FileSystemObject") ‘聲明fso對象
set yexj00=fso.GetFolder("C:\ye\") ‘獲取文件夾對象,賦于yexj00
for each i in yexj00.files ‘循環(huán)玫舉yexj00文件夾對象下的所有子集,即文件.
if fso.GetExtensionName(i)="cur" or fso.GetExtensionName(i)="ani" then ‘如果擴(kuò)展名為cur或ani才執(zhí)行下面的操作,否則不操作
s=s+1 ‘s加1,此時(shí)s為數(shù)值
fso.GetFile(i).name=CStr(s)+"."+fso.GetExtensionName(i) ‘重命名文件名為理想格式,CStr(s)是將原先的數(shù)值s轉(zhuǎn)換為字符串.
end if
next


用WMI對象列出系統(tǒng)所有進(jìn)程:

----Instance.vbs----

程序代碼 程序代碼
Dim WMI,objs
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_Process")
For Each obj In objs
Enum1 = Enum1 + obj.Description + Chr(13) + Chr(10)
Next
msgbox Enum1


獲得物理內(nèi)存的容量:

-----physicalMemory.vbs-----

程序代碼 程序代碼
strComputer = "."

Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")

For Each wbemObject In wbemObjectSet
WScript.Echo "物理內(nèi)存 (MB): " & CInt(wbemObject.TotalPhysicalMemory/1024)
Next


取得系統(tǒng)所有服務(wù)及運(yùn)行狀態(tài)

----service.vbs----
程序代碼 程序代碼
Set ServiceSet = GetObject("winmgmts:").InstancesOf("Win32_Service")
Dim s,infor
infor=""
for each s in ServiceSet
infor=infor+s.Description+" ==> "+s.State+chr(13)+chr(10)
next
msgbox infor


CPU的序列號(hào):

---CPUID.vbs---

程序代碼 程序代碼
Dim cpuInfo
cpuInfo = ""
set moc = GetObject("Winmgmts:").InstancesOf("Win32_Processor")
for each mo in moc
cpuInfo = CStr(mo.ProcessorId)
msgbox "CPU SerialNumber is : " & cpuInfo
next


硬盤型號(hào):
---HDID.vbs---
程序代碼 程序代碼
Dim HDid,moc
set moc =GetObject("Winmgmts:").InstancesOf("Win32_DiskDrive")
for each mo in moc
HDid = mo.Model
msgbox "硬盤型號(hào)為:" & HDid
next


網(wǎng)卡MAC物理地址:

---MACAddress.vbs---
程序代碼 程序代碼
Dim mc
set mc=GetObject("Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
for each mo in mc
if mo.IPEnabled=true then
msgbox "網(wǎng)卡MAC地址是: " & mo.MacAddress
exit for
end if
next


測試你的顯卡:
程序代碼 程序代碼

On Error Resume Next
Dim ye
Dim yexj00
set yexj00=GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_VideoController")
for each ye in yexj00
msgbox "型 號(hào): " & ye.VideoProcessor & vbCrLf & "廠 商: " & ye.AdapterCompatibility & vbCrLf & "名 稱: " & ye.Name & vbCrLf & "狀 態(tài): " & ye.Status & vbCrLf & "顯 存: " & (ye.AdapterRAM\1024000) & "MB" & vbCrLf & "驅(qū) 動(dòng)(dll): " & ye.InstalledDisplayDrivers & vbCrLf & "驅(qū) 動(dòng)(inf): " & ye.infFilename & vbCrLf & "版 本: " & ye.DriverVersion
next

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請遵守用戶 評(píng)論公約

    類似文章 更多