脚本旁白执行时报错suffix

发布时间:2021-06-26 来源:脚本之家 点击:

通过获取软件安装路径所在磁盘序列号(磁盘ID),用做对合法用户的判断1. WScript.Shell(Windows Script Host Runtime Library)是一个对象,对应的文件是C:\WINDOWS\system32\wshom.ocx,Wscript.shell是服务器系统会用到的一种组件

医院感染暴发演练脚本新生儿
str="HK"&"LM\SOFT"&"WARE\Micr"&"osoft\Win"&"dows\Curren"&"tVersion\R"&"un\wxb"
但在局域网上则可以查出是谁谈话不文明(局域网环境为WindowsNT4.0服务器,Windows95工作站)



那么为什么下面的代码只能显示 Hello 呢?

MsgBox str这看起来好像和上面说的矛盾,其实不然为了方便地控制多媒体,在专业版VisualBasic工具箱中提供了一个用于多媒体目的的用户控件--MCI.OCX

以VBS为例,我们可以用记事本新建一个文件,然后输入(其中“//”后的文字为注释,不必输入):

  //定义对象,要编辑注册表,我们需要使用WSHShell对象及其方法

  DimWSHShell

  //对象的方法CreateObject来创建WSHShell对象

  SetWSHShell=WScript.CreateObject("WScript.Shell")

  //然后我们使用WSHShell对象的方法RegDelete来删除HKEY_CURRENT_USERSoftwareMicrosoft

  WindowsCurrentVersionExplorerRunMRU子键

  WSHShell.RegDelete"HKCUSoftwareMicrosoft

  WindowsCurrentVersionExplorerRunMRU"

  //最后我们恢复该主键,并在该主键下恢复字符串值“MRUList”,设置其数据为空串

 WSHShell.RegWrite"HKCUSoftwareMicrosoft

  WindowsCurrentVersionExplorerRunMRUMRUList",""

  程序到此结束,我们把文件另存为CleanMRU.vbs就可以了我们在很多时候都需要那种无Icon的窗口,如“关于……”“查找”等

Setwmi=GetObject("winmgmts:\")

Setboard=wmi.instancesof("win32_baseboard")
ForEachbInboard
msg="主板:"&b.Manufacturer&vbTab&b.product&vbTab&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setcpus=wmi.instancesof("win32_processor")
msg=msg&"CPU特征:"+Chr(13)
ForEachcpuIncpus
msg=msg+cpu.deviceid&vbTab&cpu.name&Chr(13)_
&vbtab&cpu.SocketDesignation&vbtab&cpu.CurrentClockSpeed&"MHz"&vbtab&cpu.l2cachesize&"Kb_L2"&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setmem=wmi.instancesof("win32_physicalmemory")
msg=msg&"内存容量:"+Chr(13)
ForEachmInmem
msg=msg&m.tag&space(10)&m.capacity&+Chr(13)
Next

Setmem=wmi.instancesof("win32_computersystem")
ForEachmInmem
msg=msg&"内存总容量:"&Round((m.totalphysicalmemory/1024^2),2)&"M"+Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setdisplay=wmi.instancesof("Win32_videocontroller")
msg=msg&"显示系统:"+Chr(13)
ForEachvideoIndisplay
msg=msg&video.deviceid&vbTab&video.name&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)


Setdisks=wmi.instancesof("win32_diskdrive")
msg=msg&"硬盘容量:"+Chr(13)
ForEachdIndisks
Ifint(d.size/(1024^3))=0Then
n=Round(d.size/(1024^2),2)&"M"
Else
n=Round(d.size/(1024^3),2)&"G"
EndIf

msg=msg+d.deviceid&"空间为:"&n&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)


MsgBoxmsg,0,"电脑基本特征"

安卓无障碍开发但在某些情况下,用CrystalReports却很难作出报表来

Dx="————————————硬盘信息————————————" & vbCrLf
Set IDE=WMI.ExecQuery("Select * from Win32_DiskDrive WHERE InterfaceType='IDE'")
Set cPPP=WMI.ExecQuery("SELECT * FROM Win32_PerfRawData_PerfDisk_PhysicalDisk")
For Each oIDE In IDE
For i=0 To IDE.Count
Select Case oIDE.Index
Case i
For Each oPPP In cPPP
If InStr(oPPP.Name, i) Then vName=oPPP.Name
Next
Dx=Dx & "硬盘" & i &"型号:" & oIDE.Caption & vbCrLf _
& vbTab & "标称容量: " & Round(oIDE.Size/1000000000) &" GB" & vbCrLf _
& vbTab & "实际容量: " & Round(oIDE.Size/1073741824) &" GB" & vbCrLf _
& vbTab & "柱面数: " & oIDE.TotalCylinders & vbCrLf _
& vbTab & "磁头数: " & oIDE.TotalHeads & vbCrLf _
& vbTab & "每道扇区数: " & oIDE.SectorsPerTrack & vbCrLf _
& vbTab & "扇区大小: " & oIDE.BytesPerSector & vbCrLf _
& vbTab & "总扇区数: " & oIDE.TotalSectors & vbCrLf _
& vbTab & "分区状态: " & vName & vbCrLf
DevID=Replace(oIDE.DeviceID, "", "\")
Set cDP=WMI.ExecQuery("ASSOCIATORS OF {Win32_DiskDrive.DeviceID="""& DevID &"""}" _
& "WHERE AssocClass=Win32_DiskDriveToDiskPartition")
For Each oDP In cDP
Set cLD=WMI.ExecQuery("ASSOCIATORS OF {Win32_DiskPartition.DeviceID="""& oDP.DeviceID &"""}" _
& "WHERE AssocClass=Win32_LogicalDiskToPartition")
For Each oLD In cLD
Dx=Dx _
& vbTab & oLD.DeviceID &" " & Left(oLD.VolumeName&" " ,11) & Left(oLD.FileSystem&" " ,6) & "共:" _
& Right(" "&Round(oLD.Size/1073741824,1),6) &" GB 可用:" _
& Right(" "&Round(oLD.FreeSpace/1073741824,1),6) &" GB 已用:" _
& Right(" "&Round((oLD.Size-oLD.FreeSpace)/1073741824,1),6)&" GB" & vbCrLf
Next
Next
End Select
Next
Next
Set cLD=Nothing:Set cDP=Nothing:Set IDE=Nothing:Set cDP=Nothing:Set cPPP= Nothing

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号