jspωiki
NDSNTREMOVE.BAT

From TID How to manually uninstall Novell eDirectory off of a Windows Server(3004658)

Usage#

Example:
NDSNTREMOVE.BAT C:\NOVELL\NDS

What It Does#

WARNING: This file works well with eDirectory 8.5, 8.6, 8.7, and 8.8 but has not been fully tested in all environments. This procedure "scrubs" eDirectory and all associated files and references from the Windows Server (including the registry).

It does not notify other servers in the eDirectory tree. You will need to manually remove server objects and any other Windows eDirectory related objects manually. Novell is not held liable for any problems that may occur as a result of running this batch file. Use at your own risk.

Put this in a file named: NDSNTREMOVE.BAT#

@ECHO OFF
REM This is a batch file to remove eDirectory for Windows
REM

set NDSR_ERROR=0
set NDSR_BADARG=""
set NDSR_PATH=
set NDSR_LOG=NDSRemove.log

REM We must have an argument - either a help specifier or the dhost
REM installation directory (i.e. c:\Novell\NDS).
REM Right now we only support 1 argument.

if "%2%" == "" goto continue1
set NDSR_BADARG=%2
goto displayUsage

:continue1
if "%1%" == "" goto displayUsage
if "%1%" == "h" goto displayUsage
if "%1%" == "-h" goto displayUsage
if "%1%" == "H" goto displayUsage
if "%1%" == "-H" goto displayUsage
if "%1%" == "help" goto displayUsage
if "%1%" == "-help" goto displayUsage
if "%1%" == "Help" goto displayUsage
if "%1%" == "-Help" goto displayUsage
if "%1%" == "?" goto displayUsage
if "%1%" == "-?" goto displayUsage
if "%1%" == "/?" goto displayUsage
if "%1%" == "/h" goto displayUsage
if "%1%" == "/H" goto displayUsage
if "%1%" == "/help" goto displayUsage
if "%1%" == "/Help" goto displayUsage
if "%1%" == "/HELP" goto displayUsage

REM This arg must be the DHost installation path - save it.
set NDSR_PATH=%1
goto startRemove

:startRemove
echo.
echo ********************************************************************
echo NDSNTRemove
echo ********************************************************************
echo.
echo Starting eDirectory Removal...
echo.
echo Path of installed NDS is: %NDSR_PATH%
echo This batch files DOES remove the NICI pieces, so you'll have to do
echo a reboot after this, before re-installing nici.
echo.
echo --------------------------------------------------------------------
echo Stop the eDirectory-related services
echo --------------------------------------------------------------------
echo.
echo Stopping NDS Server0 and W32 SMDR NT services...
echo.
START /b /wait net stop "NDS Server0"
START /b /wait net stop "W32 SMDR"
echo.
echo *** IMPORTANT ***
echo.
echo Continue ONLY after the DHost process has exited.
echo.
echo Please use the Windows Task Manager to verify that DHost has exited.
echo It may take a few minutes for DHost to stop running.
echo.
echo Do not continue until the DHost process is not running anymore.
echo You may have to shutdown the process manually if it doesn't automatically.
echo.
pause

echo.
echo --------------------------------------------------------------------
echo Remove the eDirectory-related registry entries
echo --------------------------------------------------------------------
echo.

reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NDSonNT /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NDSonNT not found.
if %NDSR_ERROR%==0 echo Deleted: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NDSonNT
echo.

reg delete "HKLM\SOFTWARE\Novell\NDSonNT - 0" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SOFTWARE\Novell\NDSonNT - 0 not found.
if %NDSR_ERROR%==0 echo Deleted: HKLM\SOFTWARE\Novell\NDSonNT - 0
echo.

reg delete "HKLM\SOFTWARE\Novell\Portable SMDR" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SOFTWARE\Novell\Portable SMDR not found.
if %NDSR_ERROR%==0 echo Deleted: HKLM\SOFTWARE\Novell\Portable SMDR
echo.

reg delete "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\NDS Server" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\NDS Server not found
if %NDSR_ERROR%==0 echo Deleted: HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\NDS Server
echo.

reg delete "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\W32 SMDR" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\W32 SMDR not found
if %NDSR_ERROR%==0 echo Deleted: HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\W32 SMDR
echo.

reg delete "HKLM\SYSTEM\CurrentControlSet\Services\NDS Server0" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SYSTEM\CurrentControlSet\Services\NDS Server0 not found
if %NDSR_ERROR%==0 echo Deleted: HKLM\SYSTEM\CurrentControlSet\Services\NDS Server0
echo.

reg delete "HKLM\SYSTEM\CurrentControlSet\Services\NICICCS" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SYSTEM\CurrentControlSet\Services\NICICCS not found
if %NDSR_ERROR%==0 echo Deleted: HKLM\SYSTEM\CurrentControlSet\Services\NICICCS
echo.

reg delete "HKLM\SYSTEM\CurrentControlSet\Services\W32 SMDR" /F
set NDSR_ERROR=%errorlevel%
if %NDSR_ERROR%==2 echo HKLM\SYSTEM\CurrentControlSet\Services\W32 SMDR not found
if %NDSR_ERROR%==0 echo Deleted: HKLM\SYSTEM\CurrentControlSet\Services\W32 SMDR
echo.

echo.
echo --------------------------------------------------------------------
echo Delete the files
echo --------------------------------------------------------------------
echo.

echo SystemRoot = %SystemRoot%
echo Deleting %SystemRoot%\system32\gc080352.dll
del %SystemRoot%\system32\gc080352.dll /f /q
echo Deleting %SystemRoot%\system32\ldapsdk.dll
del %SystemRoot%\system32\ldapsdk.dll /f /q
echo Deleting %SystemRoot%\system32\ldapssl.dll
del %SystemRoot%\system32\ldapssl.dll /f /q
echo Deleting %SystemRoot%\system32\ldapx.dll
del %SystemRoot%\system32\ldapx.dll /f /q
echo Deleting %SystemRoot%\system32\NDSCons.exe
del %SystemRoot%\system32\NDSCons.exe /f /q
echo Deleting %SystemRoot%\system32\NDScpa.cpl
del %SystemRoot%\system32\NDScpa.cpl /f /q
echo Deleting %SystemRoot%\system32\nssl.dll
del %SystemRoot%\system32\nssl.dll /f /q
echo Deleting %SystemRoot%\system32\PKIAPI.dll
del %SystemRoot%\system32\PKIAPI.dll /f /q
REM For pre-Tao installs
echo Deleting %SystemRoot%\system32\gcmts.dll
del %SystemRoot%\system32\gcmts.dll /f /q
echo Deleting %SystemRoot%\system32\sal.dll
del %SystemRoot%\system32\sal.dll /f /q
echo.

echo Stopping the NICI driver...
net stop niciccs

REM We might need to sleep for a couple of seconds once NICI is shutdown before we try to delete it...

echo Deleting %SystemRoot%\system32\drivers\niciccs.sys
del %SystemRoot%\system32\drivers\niciccs.sys /f /q

echo Deleting %SystemRoot%\system32\Novell\NICI\*.*
del %SystemRoot%\system32\Novell\NICI\*.* /f /q
echo Deleting %SystemRoot%\system32\Novell\nds\*.*
del %SystemRoot%\system32\Novell\nds\*.* /f /q
echo.

echo SystemDrive = %SystemDrive%
echo Removing directory %SystemDrive%\Program Files\Common Files\Novell\ni
rmdir "%SystemDrive%\Program Files\Common Files\Novell\ni" /s /q
echo.

echo NDS path = %NDSR_PATH%
del %NDSR_PATH%\SMS\NLS\*.* /f /q
echo Removing directory %NDSR_PATH%\SMS\NLS
rmdir %NDSR_PATH%\SMS\NLS /s /q
echo Deleting %NDSR_PATH%\SMS\*.*
del %NDSR_PATH%\SMS\*.* /f /q
echo Removing directory %NDSR_PATH%\SMS
rmdir %NDSR_PATH%\SMS /s /q

echo Deleting %NDSR_PATH%\NLS\*.*
del %NDSR_PATH%\NLS\*.* /f /q
echo Removing directory %NDSR_PATH%\NLS
rmdir %NDSR_PATH%\NLS /s /q

echo Deleting %NDSR_PATH%\DIBFiles\*.*
del %NDSR_PATH%\DIBFiles\*.* /f /q
echo Removing directory %NDSR_PATH%\DIBFiles
rmdir %NDSR_PATH%\DIBFiles /s /q

echo Deleting %NDSR_PATH%\*.*
del %NDSR_PATH%\*.* /f /q
echo Removing directory %NDSR_PATH%
rmdir %NDSR_PATH% /s /q


echo.
echo ********************************************************************
echo NDSNTRemove Complete
echo ********************************************************************
echo.
goto realEnd

:displayUsage
if %NDSR_BADARG% == "" goto OKUsage
echo NDSNTRemove: Invalid command-line argument: %NDSR_BADARG%

:OKUsage
echo.
echo This command removes the locally installed NDS.
echo.
echo " Usage: NDSNTRemove [[-|/]h|help|?] | [drive:\DHostPath] "
echo " "
echo " [-|/]h|help|? displays this Usage statement "
echo " drive:\DhostPath where DHost is installed "
echo.
echo One argument must be specified. It can be either a help
echo specifier or the path to where Dhost is installed.
echo.
echo Example: To remove the NDS installation at c:\Novell\NDS,
echo type "NDSNTRemove c:\Novell\NDS" at the command prompt.
echo.
echo Example: To find out how to use this command,
echo type "NDSNTRemove /?" at the command prompt, or,
echo type "NDSNTRemove -h" at the command prompt
echo.
goto realEnd

:realEnd
set NDSR_ERROR=
set NDSR_BADARG=
set NDSR_PATH=
set NDSR_LOG=
REM This is the end