Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Change  the  Drive  Letter  of  a  Volume  

 Content of Change the Drive Letter of a Volume.vbs
MD5 Hash: 03FAD23D3C1F8646A0622F60C0620613
' Description: Changes the drive letter of volume D to Q. If you modify this script to change the drive letter of a volume other than D, note that the volume name in the WQL query must include both the colon (:) and two slashes (\\). Thus drive C would look like this: C:\\. When specifying the new drive letter, however, you only have to include the colon (in the sample script, Q:).


strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colVolumes = objWMIService.ExecQuery _
("Select * from Win32_Volume Where Name = 'D:\\'")

For Each objVolume in colVolumes
objVolume.DriveLetter = "Q:"
objVolume.Put_
Next

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a