' *********** Start Code ***********
' Script that removes Novell NW Client 4.x "silently"
' Tested on NW Clent version 4.8 and Win2000
' NT 4.0 without WMI installed will have a problem
' with the DeleteRegistryKey Sub routine.
' Author: Torgeir Bakken
rem ***** test to see if this script has already run before on this computer
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
outputfile = "C:\NWREMOVE.TXT"
If oFSO.FileExists(outputfile) Then Wscript.Quit
set WSHNetwork = wscript.CreateObject("WSCript.Network")
If oFSO.FolderExists("J:\") then WsHNetwork.RemoveNetworkDrive "J:", true
WSHNetwork.MapNetworkDrive "J:", "\\pdmis-docs\sys", False
'MsgBox "This script will un-install the NetWare client software from your Windows NT or Windows 2000 workstation." & vbCrLf & _
' "The last screen will display a message that the 'The installation was not completed successfully.'" & vbCrLf & _
' "This message is normal and does not mean that anything is broken. " & vbCrLf & vbCrLf & _
' "At the end of the un-install script a message will be displayed asking you to reboot your workstation." & vbCrLf & _
' "Please reboot at that time to insure that you do not lose your connection to the network." & vbCrLf & vbCrLf & _
' "If you have any questions or problems with these instructions, please call System Support, ext 3524."
' On NT-based OS's, RegDelete can't delete a key if there exists subkeys
' Using WMI instead, see seperate Sub DeleteRegistryKey(hive,key)
' (WMI is preinstalled on Win2k/WinXP/WinME, can be installed on NT4/Win9x)
Set oRegistry = GetObject("winmgmts:root/default:StdRegProv")
Const HKCR = &H80000000 'HKEY_CLASSES_ROOT
Const HKCU = &H80000001 'HKEY_CURRENT_USER
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
Const HKEY_DYN_DATA = &H80000006
' From Novell TID2948079
' Unattended Remove of the NT Client
' [URL unfurl="true"]http://support.novell.com/cgi-bin/search/searchtid.cgi?/2948079.htm[/URL]
' J:\NWClient48\i386\ is the NW Client install source (full package)
' J:\NWClient48\CleanUp\NWUninst.ini is the unattend file
' They can be placed on the network, you should not be disconnected
' from the server during or after install.
' You must do a reboot before the connection is lost.
' WMI can be used to start the reboot :-)
' NB! No spaces in the path is allowed (if you change the path)
sNwclntCmd = "J:\NWC\i386\setupnw.exe /U:J:\NWC\NWUninst.ini"
' Starting the uninstall!
oShell.Run sNwclntCmd, 1, True
' From Novell TID10013922 and then some
' [URL unfurl="true"]http://support.novell.com/cgi-bin/search/searchtid.cgi?/10013922.htm[/URL]
' This is _very_ important, GinaDLL is critical to get right!
sGinaPath = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon\GinaDLL"
oShell.RegWrite sGinaPath, "MSGINA.DLL"
DeleteRegistryKey HKLM, "SOFTWARE\Novell"
DeleteRegistryKey HKLM, "SYSTEM\CurrentControlSet\Services\NetWareWorkstation"
DeleteRegistryKey HKLM, "SYSTEM\CurrentControlSet\Control\Print\Providers\Netware Print Services"
DeleteRegistryKey HKLM, "SYSTEM\CurrentControlSet\Control\Print\Providers\Novell Distributed Print Services"
DeleteRegistryKey HKCU, "SOFTWARE\NetWare"
' You can use Netset.exe from the Win2000 Resource Kit to remove any
' IPX protocol if necessary, among other things:
' Netset.exe is a standalone utility that you can use to add,
' remove, or change the network configuration of a client
' computer that has Windows 2000 already installed on it.
' For example, you can use this tool to remove a protocol,
' such as Internetwork Package Exchange (IPX) or NetBeui,
' from a client that is no longer used on your network.
' You can also use this tool to change the Internet
' Protocol (IP) information on a group of servers or
' workstations without using the user interface.
' More at:
' Description of the Netset.exe Tool from the Windows 2000 Resource Kit (Q268781)
' [URL unfurl="true"]http://support.microsoft.com/default.aspx?scid=kb;en-us;Q268781[/URL]
' I have not tried this myself, so I have no IpxRemove.ini to offer ;-)
' Because of that, the two lines below are commented out.
' sNetSetCmd = "J:\NWClient48\CleanUp\NetSet.exe J:\NWClient48\CleanUp\IpxRemove.ini"
' oShell.Run sNetSetCmd, 0, True
'msgbox "Please reboot your computer now."
Set f = oFSO.OpenTextFile(outputfile, ForWriting, True)
f.Writeline ("Novell Client Removed " & date & " " & time)
f.Close
oShell.Run "shutdown -r -t 5"
Sub DeleteRegistryKey(hive,key)
On Error Resume Next
rc = oRegistry.EnumKey(hive,key,arSubKeys)
For Each sKey In arSubKeys
If Err Then
Err.Clear
Exit Sub
End If
DeleteRegistryKey hive, key & "\" & sKey
Next
rc = oRegistry.DeleteKey(hive,key)
End Sub
' *********** End Code ***********