How to get the current path using VBScript

To get the current path using VBScript you can use the snippet below.

Samples

VBScript Sample

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to use the Microsoft Speech API in VBScript

To use the Microsoft Speech API in VBScript you can use the following snippet.

Sample VBScript

dim sTextToSpeech 
sTextToSpeech = "HELLO WORLD!"
set ObjVoice = CreateObject("SAPI.SpVoice") 
ObjVoice.Speak sTextToSpeech 

Please rate this snippet

How to list the installed software using vbscript

to list installed software in vbscript you can use the following snippet.
It will export a CSV file with the installed software.

Sample VBScript

Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
Set objFile = objFileSystemObject.CreateTextFile("C:\CodesnippetsFesslersoft_InstalledSoftware.csv", True)
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colInstalledSoftware = objWMI.ExecQuery("Select * from Win32_Product")

'Header
objFile.WriteLine "" & chr(34) & "Caption" & chr(34) & ";" & chr(34) & "Description" & chr(34) & ";" & chr(34) & "Identifying Number" & chr(34) & ";" & chr(34) & "Install Date" & chr(34) & ";" & chr(34) & "Install Location" & chr(34) & ";" & chr(34) & "Install State" & chr(34) & ";" & chr(34) & "Name" & chr(34) & ";" & chr(34) & "Package Cache" & chr(34) & ";" & chr(34) & "SKU Number" & chr(34) & ";" & chr(34) & "Vendor" & chr(34) & ";" & chr(34) & "Version" & chr(34) & ";" 
		
'content
For Each objInstalledSoftware in colInstalledSoftware
	on error resume next
	objFile.WriteLine  chr(34) & objInstalledSoftware.Caption & chr(34) & ";" & chr(34) & objInstalledSoftware.Description & chr(34) & ";" & chr(34) & objInstalledSoftware.IdentifyingNumber & chr(34) & ";" & chr(34) & objInstalledSoftware.InstallDate2 & chr(34) & ";" & chr(34) & objInstalledSoftware.InstallLocation & chr(34) & ";" & chr(34) & objInstalledSoftware.InstallState & chr(34) & ";" &  chr(34) & objInstalledSoftware.Name & chr(34) & ";" & chr(34) & objInstalledSoftware.PackageCache & chr(34) & ";" & chr(34) & objInstalledSoftware.SKUNumber & chr(34) & ";" & chr(34) & objInstalledSoftware.Vendor & chr(34) & ";" & chr(34) & objInstalledSoftware.Version & chr(34) & ";"
Next
objFile.Close

Call msgbox("done",0,"codesnippets.fesslersoft.de")

Please rate this snippet

How to open cd rom drives in VBScript

To open cd rom drives in VBScript you can use the following snippet.

Sample VBScript

Set wmPlayer = CreateObject("WMPlayer.OCX.7" )
Set colDrives = wmPlayer.cdromCollection

if colDrives.Count >= 1 then
        For i = 0 to colDrives.Count - 1
			colDrives.Item(i).Eject
        Next
End If

Please rate this snippet