tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 VB Script > Advanced > System Info

System Info 

This example shows accessing system information.

File Name  :  
source/VBS/advanced/system_info.vbs 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
01'Local computer
02strCompName = "."
03 
04Set wmiSvcObj = GetObject("winmgmts:\\" & strCompName & "\root\CIMV2")
05Set selSysInfo = wmiSvcObj.ExecQuery("SELECT * FROM Win32_OperatingSystem")
06 
07For Each sysInfo In selSysInfo
08 
09  WScript.Echo "System Drive: " & sysInfo.SystemDrive 
10  WScript.Echo "System Directory: " & sysInfo.SystemDirectory
11  WScript.Echo "Windows Directory: " & sysInfo.WindowsDirectory
12 
13  WScript.Echo "Boot Device: " & sysInfo.BootDevice
14  WScript.Echo "System Device: " & sysInfo.SystemDevice
15 
16Next

It gives the following output,
System Drive: C:
System Directory: C:\WINDOWS\system32
Windows Directory: C:\WINDOWS
Boot Device: \Device\HarddiskVolume1
System Device: \Device\HarddiskVolume1



 
  


  
bl  br