Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i delete a registry value which contains back slashes?

WSH Issues - General

How do i delete a registry value which contains back slashes?

by  mrmovie  Posted    (Edited  )
'WshShell.RegDelete will fail if the value contains '\\'
'dont not run this script as it will delete all your printers

Const HKCU = &H80000001
strKeyPath = "Printers\Settings"

Set refRegObject = GetObject("Winmgmts:root\default:StdRegProv")

If refRegObject.EnumValues(HKCU, strKeyPath, arrValueNames, arrValueTypes) = 0 Then
For i = 0 to UBound(arrValueNames)
msgbox arrValueNames(i)
refRegObject.DeleteValue HKCU, strKeyPath, CStr(arrValueNames(i))
Next
End If

Set refRegObject = Nothing
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top