Disabling DVD Drive
Scooby Regular
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
We hide all drive letters apart from s and p... so I wrote the following script to find cd rom drives and make them visible... you could alter it do the opposite...
' ************************************************** *************
' * Enumerate CD-Rom Drive Letter and Change Visible Drive Mask *
' * David Wallis, PC / Server Support, 25/02/2002 *
' ************************************************** *************
On Error Resume Next
Dim FSys, xDrive, xDrives, intTestAsc
Set WShell = CreateObject("Wscript.Shell")
Set FSys = CreateObject("Scripting.FileSystemObject")
Set xDrives = FSys.Drives
intCurrValue = "" ' Set to avoid problems with an empty reg key and using <> 0
For Each xDrive in xDrives
If xDrive.DriveType = 4 Then
intAsciDriveLetter = (Asc(xDrive.DriveLetter))
intTmpValue = intAsciDriveLetter - 64
intDecValue = 2 ^ intTmpValue
intTmpValue = NOT(intDecValue)
intcurrValue = WShell.RegRead("HKCU\Software\Microsoft\Windows\Cu rrentVersion\Policies\Explorer\NoDrives")
If intCurrValue <> "" Then
intNewValue = intTmpValue AND intCurrValue
RetCode = WShell.RegWrite("HKCU\Software\Microsoft\Windows\C urrentVersion\Policies\Explorer\NoDrives", intNewValue,"REG_SZ")
End If
End If
Next
Set xDrive = Nothing
Set xDrives = Nothing
Set FSys = Nothing
Set WShell = Nothing
May have to click edit post for formatting...
David
' ************************************************** *************
' * Enumerate CD-Rom Drive Letter and Change Visible Drive Mask *
' * David Wallis, PC / Server Support, 25/02/2002 *
' ************************************************** *************
On Error Resume Next
Dim FSys, xDrive, xDrives, intTestAsc
Set WShell = CreateObject("Wscript.Shell")
Set FSys = CreateObject("Scripting.FileSystemObject")
Set xDrives = FSys.Drives
intCurrValue = "" ' Set to avoid problems with an empty reg key and using <> 0
For Each xDrive in xDrives
If xDrive.DriveType = 4 Then
intAsciDriveLetter = (Asc(xDrive.DriveLetter))
intTmpValue = intAsciDriveLetter - 64
intDecValue = 2 ^ intTmpValue
intTmpValue = NOT(intDecValue)
intcurrValue = WShell.RegRead("HKCU\Software\Microsoft\Windows\Cu rrentVersion\Policies\Explorer\NoDrives")
If intCurrValue <> "" Then
intNewValue = intTmpValue AND intCurrValue
RetCode = WShell.RegWrite("HKCU\Software\Microsoft\Windows\C urrentVersion\Policies\Explorer\NoDrives", intNewValue,"REG_SZ")
End If
End If
Next
Set xDrive = Nothing
Set xDrives = Nothing
Set FSys = Nothing
Set WShell = Nothing
May have to click edit post for formatting...
David
Thread
Thread Starter
Forum
Replies
Last Post
gazzawrx
Non Car Related Items For sale
13
Oct 17, 2015 06:51 PM




