Showing posts with label vbs script. Show all posts
Showing posts with label vbs script. Show all posts

Friday, July 6, 2012

VBScript to Display Logical Disk Information

Instructions for your Logical Disk Information WMI Script

Copy and paste the example script below into notepad or a VBScript editor.
Decide which machine on your network to interrogate and then change line 10:
strComputer = "NetworkMachine" to the name of that machine. Alternatively change strComputer to the local machine by substituting a period or "." strComputer = "."
Save the file with a .vbs extension, for example: LogicalDisk.vbs
Double click LogicalDisk.vbs and check the properties of each partition.

Script to Interrogate Logical Disk
' LogicalDisk.vbs
' Sample VBScript to interrogate a Logical disk with WMI
' Author Guy Thomas http://computerperformance.co.uk/
' Version 1.8 - November 2005
' -------------------------------------------------------------'
Option Explicit
Dim objWMIService, objItem, colItems, strComputer 

On Error Resume Next
strComputer = "."

Set objWMIService = GetObject _
("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _ 
("Select * from Win32_LogicalDisk")

For Each objItem in colItems
Wscript.Echo "Computer: " & objItem.SystemName & VbCr & _
" ==================================" & VbCr & _
"Drive Letter: " & objItem.Name & vbCr & _
"Description: " & objItem.Description & vbCr & _
"Volume Name: " & objItem.VolumeName & vbCr & _
"Drive Type: " & objItem.DriveType & vbCr & _
"Media Type: " & objItem.MediaType & vbCr & _
"VolumeSerialNumber: " & objItem.VolumeSerialNumber & vbCr & _
"Size: " & Int(objItem.Size /1073741824) & " GB" & vbCr & _
"Free Space: " & Int(objItem.FreeSpace /1073741824) & _
" GB" & vbCr & _
"Quotas Disabled: " & objItem.QuotasDisabled & vbCr & _
"Supports DiskQuotas: " & objItem.SupportsDiskQuotas & vbCr & _
"Supports FileBasedCompression: " & _
objItem.SupportsFileBasedCompression & vbCr & _
"Compressed: " & objItem.Compressed & vbCr & _
""
Next

WSCript.Quit

' End of Sample DiskDrive VBScript

Saturday, November 12, 2011

Crazy notepad trick to continuously popout cd tray


Continuously pop out your friend’s CD Drive. If he / she has more than one, it pops out all of them! By seeing the below image I hope you will understand what the below crazy script actually does.
Crazy notepad trick to continuously popout cd tray