'WMI-SetOpticalDriveLetter-Remote.vbs 'For moving the optical drive of a remote machine. 'Contains code from http://www.visualbasicscript.com/tm.aspx?high=&m=30133&mpage=1. '20110510, v1. Set objLocator = CreateObject("WbemScripting.SWbemLocator") strComputer = "10.1.1.1" strAcc = "administrator" strPassword = "password" Set objWMIService = objLocator.ConnectServer ( strComputer, "\root\cimv2", strComputer & "\" & strAcc, strPassword ) objWMIService.Security_.impersonationlevel = 3 'Select all volumes of type compact disc. 'http://msdn.microsoft.com/en-us/library/aa394515(v=VS.85).aspx - Win32_Volume Class. Set colVolumes = objWMIService.ExecQuery ("SELECT * FROM Win32_Volume WHERE DriveType = 5") For Each vol in colVolumes If vol.DriveLetter = "E:" Then vol.DriveLetter = "X:" vol.Put_ End If Next Set colVolumes = Nothing Set objWMIService = Nothing Set objLocator = Nothing