Archive for June, 2010:

WSH script to remove system and user DSN

‘Gregor Stefka Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_CURRENT_USER  = &H80000001 strComputer  = “.” strDSN  = “YourDSN” Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & _     strComputer & “\root\default:StdRegProv”)   strKeyPath = “SOFTWARE\ODBC\ODBC.INI\” & strDSN objReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath objReg.DeleteKey HKEY_CURRENT_USER, strKeyPath strKeyPath = “SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources” objReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strDSN objReg.DeleteValue HKEY_CURRENT_USER ,strKeyPath,strDSN

Leave a Comment

WSH Script to add or replace system path variable

strNewPath  =”d:\newpath;” strPathToReplace =”f:\pathToReplace;” ‘********************************* SET YOUR PATH ABOVE************************ ‘Gregor Stefka Const HKEY_LOCAL_MACHINE  = &H80000002 strComputer    = “.” strKeyPath    = “SYSTEM\CurrentControlSet\Control\Session Manager\Environment” strValueName    = “Path” Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\default:StdRegProv”) oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath, strValueName,strValue bAllreadySet    = InStr(1, strValue, strNewPath, 1) ‘Wscript.Echo  “The OldPath is: ” & strValue ‘Only add if its not set: If bAllreadySet = 0 […]

Leave a Comment

My new guitar: Gibson Les Paul Studio Faded (Limited WCCR)

A few pics of my new baby…

Tags: , ,

Leave a Comment