共享vbs脚本就事的趣味ITeyedongfang - 娱乐之横扫全球

共享vbs脚本就事的趣味ITeyedongfang

2019-02-01 09:17:58 | 作者: 恨蕊 | 标签: 目标,文件夹,格局 | 浏览: 7069

今日偶尔发现金庸网游的文件夹下的cur和ani格局的图标文件都不错,所以把它们复制到C:\ye下,依照我的习气,我会把文件名改名为1.cur,2.ani这样的写法,所以想起来vbs脚本. 能够存放于恣意目录下.
aa.vbs

dim fso,yexj00,s
set fso=createobject("Scripting.FileSystemObject") 声明fso目标
set yexj00=fso.GetFolder("C:\ye\") 获取文件夹目标,赋于yexj00
for each i in yexj00.files 循环玫举yexj00文件夹目标下的一切子集,即文件.
if fso.GetExtensionName(i)="cur" or fso.GetExtensionName(i)="ani" then 假如扩展名为cur或ani才履行下面的操作,否则不操作
s=s+1 s加1,此刻s为数值
fso.GetFile(i).name=CStr(s)+"."+fso.GetExtensionName(i) 重命名文件名为抱负格局,CStr(s)是将原先的数值s转换为字符串.
end if



用WMI目标列出体系一切进程:

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) 
msgbox Enum1



获得物理内存的容量:

-physicalMemory.vbs-


strComputer = "." 
Set wbemServices = GetObject("winmgmts:\\" strComputer) 
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration") 
For Each wbemObject In wbemObjectSet 
WScript.Echo "物理内存 (MB): " CInt(wbemObject.TotalPhysicalMemory/1024)
Next 



获得体系一切效劳及运转状况

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)
msgbox infor


CPU的序列号:

-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



硬盘类型:
-HDID.vbs-

Dim HDid,moc
set moc =GetObject("Winmgmts:").InstancesOf("Win32_DiskDrive")
for each mo in moc
HDid = mo.Model
msgbox "硬盘类型为:" HDid



网卡MAC物理地址:

-MACAddress.vbs-

Dim mc
set mc=GetObject("Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
for each mo in mc
if mo.IPEnabled=true then
msgbox "网卡MAC地址是: " mo.MacAddress
exit for
end if



测验你的显卡:

程序代码

On Error Resume Next
Dim ye
Dim yexj00
set yexj00=GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_VideoController")
for each ye in yexj00
msgbox "型 号: " 
 ye.VideoProcessor vbCrLf "厂 商: " 
 ye.AdapterCompatibility vbCrLf "名 称: " 
 ye.Name vbCrLf "状 态: " 
ye.Status vbCrLf "显 存: " 
(ye.AdapterRAM\1024000) "MB" vbCrLf "驱 动(dll): " 
 ye.InstalledDisplayDrivers vbCrLf "驱 动(inf): " 
 ye.infFilename vbCrLf "版 本: " ye.DriverVersion
next 



版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表娱乐之横扫全球立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章