Uninstall Novell Client (silently)
Now, I realize that this is going to be a very specific-case post, as not everyone is using Novell, and even then, not everyone is going to be running into the same problems we are. However, perhaps what I ran across will be useful for at least some people.
The day we began uninstalling Novell Client was a happy day in my life. I never have liked needing a separate client to do what can be done with Active Directory and domain services built-in to the Windows operating system. However, I quickly found out that uninstalling Novell Client (the version we are using is 4.95) is not a simple task to automate with a basic batch file. I like making my life easier, even if I can't push out a batch file to multiple computers I like being able to automate the tasks so I don't have to mindlessly click the same prompts over and over and over….ad nauseam.
I ran across the following command:
This command, when run from a command window and/or batch file, launches the Novell Client uninstall, but you still have to click "Yes" to remove the client, and then "No" at the end (in my case) to suppress a reboot so more system configuration can take place.
Now, I'm sure you are sitting on the edge of your seat, biting your fingernails in feverish anticipation, because you are sure I have figured this out. And you are right, I did figure out a way to script it, so stop chewing your fingernails down to nubbins.
How? Through the use of a very powerful program that I had heard of before, but never used: AutoIt. AutoIt is a very powerful scripting language that allows you to script things that normally refuse to be automated (case in point: Novell Client uninstallation). I'll show you the code first, and then we can talk about it:
Now, all that script should be fairly self-explanatory for the most part if you're familiar with writing batch files and other scripting languages. If not, a quick explanation is that we launch the uninstallation through the commandline, then wait for the "Are you sure you want to uninstall Novell Client?" window to pop up, have the script press "Yes". Then, the script waits for the second message box to pop up that asks if we want to reboot after the uninstall, then sends the ALT+N command, which presses "No". You may ask yourself how does the script know when to press yes or no? Well, it's based off the window title, as far as I can tell. The window title is, specifically, "Uninstall Novell Client for Windows". The script, apparently, waits for that specific window title to show up before it actually does anything. I'm no AutoIt expert, but I got this working which I'm pretty excited about. Beyond that, I'd have to google for answers.
The really, really cool thing about AutoIt is that you can compile the script you write into an exe file, and include that in your normal batch file. For example, I complied my script into an exe file and included it in a batch file which will edit a registry key or two to turn on automatic login for the the default user account on the computer, since network access is totally disabled for the computer that the Novell Client was uninstalled on--at least until we get our domain setup.
Like I mentioned before, I am no AutoIt expert, but it is quite the amazing scripting program. I have posted the script and the exe file as a bundle in case anyone would like to use it. No guarantees it will work in your environment, but you're more than welcome to modify the script and do what you'd like with it. Click here to download the script source and compiled executable file.
The day we began uninstalling Novell Client was a happy day in my life. I never have liked needing a separate client to do what can be done with Active Directory and domain services built-in to the Windows operating system. However, I quickly found out that uninstalling Novell Client (the version we are using is 4.95) is not a simple task to automate with a basic batch file. I like making my life easier, even if I can't push out a batch file to multiple computers I like being able to automate the tasks so I don't have to mindlessly click the same prompts over and over and over….ad nauseam.
I ran across the following command:
RUNDLL32.EXE NWSETUP.DLL NWUninstallClient
This command, when run from a command window and/or batch file, launches the Novell Client uninstall, but you still have to click "Yes" to remove the client, and then "No" at the end (in my case) to suppress a reboot so more system configuration can take place.
Now, I'm sure you are sitting on the edge of your seat, biting your fingernails in feverish anticipation, because you are sure I have figured this out. And you are right, I did figure out a way to script it, so stop chewing your fingernails down to nubbins.
How? Through the use of a very powerful program that I had heard of before, but never used: AutoIt. AutoIt is a very powerful scripting language that allows you to script things that normally refuse to be automated (case in point: Novell Client uninstallation). I'll show you the code first, and then we can talk about it:
; Run the Novell Client uninstall from commandline
Run("RUNDLL32.EXE NWSETUP.DLL NWUninstallClient")
; Wait for message box to become active
WinWaitActive("Uninstall Novell Client for Windows")
; We are sure we want to uninstall, so we tell AutoIt to press "enter"
Send ("{ENTER}")
; Again, we wait for the reboot prompt here
WinWaitActive("Uninstall Novell Client for Windows")
; Send the command ALT+N to say No to the reboot so we can continue with other batch processing
Send("!n")
; Finished!
Now, all that script should be fairly self-explanatory for the most part if you're familiar with writing batch files and other scripting languages. If not, a quick explanation is that we launch the uninstallation through the commandline, then wait for the "Are you sure you want to uninstall Novell Client?" window to pop up, have the script press "Yes". Then, the script waits for the second message box to pop up that asks if we want to reboot after the uninstall, then sends the ALT+N command, which presses "No". You may ask yourself how does the script know when to press yes or no? Well, it's based off the window title, as far as I can tell. The window title is, specifically, "Uninstall Novell Client for Windows". The script, apparently, waits for that specific window title to show up before it actually does anything. I'm no AutoIt expert, but I got this working which I'm pretty excited about. Beyond that, I'd have to google for answers.
The really, really cool thing about AutoIt is that you can compile the script you write into an exe file, and include that in your normal batch file. For example, I complied my script into an exe file and included it in a batch file which will edit a registry key or two to turn on automatic login for the the default user account on the computer, since network access is totally disabled for the computer that the Novell Client was uninstalled on--at least until we get our domain setup.
Like I mentioned before, I am no AutoIt expert, but it is quite the amazing scripting program. I have posted the script and the exe file as a bundle in case anyone would like to use it. No guarantees it will work in your environment, but you're more than welcome to modify the script and do what you'd like with it. Click here to download the script source and compiled executable file.
Thanks for this info...it helps a lot. We are also in a process of uninstalling Novell Client and going with Active Directory.
ReplyDeleteThis is awesome, tested and used it succesfuly. thanks.
ReplyDeleteAfter a couple hours of playing around with this tool and figuring out how it works, I love it! I'm so glad I found this blog post. I definitely intend on learning more of the commands that it can handle.
ReplyDeleteFor the Novell piece specifically, I found another VB Script that will remove the client for XP and 7 alike, but you have to ensure AutoIt is launching an EXECUTABLE. I tried getting it to launch a VBS file and it wouldn't work - once I added "cscript.exe RemoveNovell.vbs" this worked without a hitch! I was able to package it in SCCM and push it to our machines that needed the client removed.
VB Script for removing Novell Client for Windows from XP and 7:
http://www.powershellr.com/2013/12/remove-novell-client.html?showComment=1439501987368#c7295015906885196284
Michael, it surprises me that some of my old posts are actually useful! This is great!
ReplyDeleteThanks for contributing your tips and sharing your VB Script. That's awesome you were able to use this with SCCM as well.