|
|
|||||||
I need to run a program (I am sure will need local admin rights) to uninstall Trend version 8. The server for trend OfficeScan8 went south and all clients lost connection - after a week with support they finally suggest to re-install server. I decided to up grade as well so I installed OfficeScan server 10 on another server and deleted the old version8. Now I can manually uninstall OFCscan from each pc(about 120) then install the new version - works fine - but as a 1 man shop it will be 2 week just doing this. Support gave me a program to use to uninstall, but I need to run it in KiXtart as I cannot control AD. Then I can run another to install OFCScan10. Server is 2003 and clients are all XP min sp2. Server = WHCHsrvr2 share = \ofcscan files = CmnUnins.exe - to uninstall = Autopcc.exe - to install new If I don't have a way to check the version of OfficeScan and pass the uninstall program it will uninstall the new version as well... I appreciate any help. Glenn |
||||||||
|
|
|||||||
Welcome to Korg! Kix can certainly help.. I'm guessing that you can either read a registry key or a file path location to determine the version. In some cases, you'd need to read a registry key to locate the install location, and then read the file version. Either way, Kix can do that in just a few lines using the built-in commands. I don't have access to any systems with Trend, so if you can provide either a standard file or registry path, we can illustrate how to script this. Glenn |
||||||||
|
|
|||||||
I do not know the registry keys... The path for the program is: C:\Program Files\Trend Micro\OfficeScan Client\ Not sure what else you will need here... The ofcscan.ini file will give the version. ================================================= old version: [INI_PROGRAM_VERSION_SECTION] Pattern_Last_Update=20090315002615 PccNT_Version=8.0 PccNT_Last_Update=20090224112218 Pccw16_Version=8.0 Pccw16_Last_Update=20090224112218 Engine31_Version=5.500 Engine31_Last_Update=20090224112218 Program_Version=8.0 Program_Last_Update=20090224112218 EngineNT_Version=8.911.1001 EngineNT_Last_Update=20090301004749 ====================================================== and New version: [INI_PROGRAM_VERSION_SECTION] Pattern_Last_Update=20100214013419 PccNT_Version=10.0 PccNT_Last_Update=20100204170316 Pccw16_Version=10.0 Pccw16_Last_Update=20100204170316 Engine31_Version=5.500 Engine31_Last_Update=20100204170316 Program_Version=10.0 Program_Last_Update=20100204170316 EngineNT_Version=9.100.1001 EngineNT_Last_Update=20100204175638 I really appreciate the help! PS. I don't think the rocket made it to Tn that I have seen anyway! |
||||||||
|
|
|||||||
LOL! Thanks for keeping an eye out! For your project, ReadProfileString() is your best friend. You can do something like this: Code: $File = 'C:\Program Files\Trend Micro\OfficeScan Client\ofcscan.ini' $Version = ReadProfileString($File, 'INI_PROGRAM_VERSION_SECTION', 'PccNT_Version') If Val($Version) < 10 'Need to upgrade!' ? Shell 'Insert Upgrade Command Here' Else 'Version 10 or higher - no upgrade needed!' ? EndIf Put a ";" in front of the Shell line (comment it to prevent it from running) and give that a try on a few systems. Test it on systems with version 8 and version 10. If you get the correct messages, then you can replace the command string with the uninstall command and remove the comment and run it for real. Glenn |
||||||||
|
|
|||||||
Wow, that is awesome, I thought it was going to be a lot more confusing than that! I will let you know how it turns out! Glenn |
||||||||
|
|
|||||||
For the most part it seems to work. A couple I tested didn't seem to finish the uninstall completly -ie delete the directory - and it does require local admin rights. Most of the users here (regretably from past admin) have local admin rights so I think it will work ok. I found some code from Trend thought the premise was interesting - waiting for the directory to be deleted (could cause an infinate loop) Create a login script in a GPO using the following command: @ECHO OFF IF EXIST "C:\tm_installed.txt" GOTO EXIT \\ :LOOP ping -n 60 127.0.0.1 > NUL IF EXIST "%ProgramFiles%\Trend Micro\OfficeScan Client" GOTO LOOP \\ ECHO "installed" > "C:\tm_installed.txt" :EXIT This is what I am currently using... ;================================================================== ; Check and install if needed - New Trend Micro ;================================================================== $File = 'C:\Program Files\Trend Micro\OfficeScan Client\ofcscan.ini' $Version = ReadProfileString($File, 'INI_PROGRAM_VERSION_SECTION', 'PccNT_Version') If Val($Version) < 10 'Need to upgrade!' ? 'Please wait...uninstalling old software...' ? Shell '\\whchsrvr2\ofcscan\CmnUnins.exe' 'Installing new software...' ? Shell '\\whchsrvr2\ofcscan\autopcc.exe' Else 'Version 10 or higher - no upgrade needed!' ? EndIf any more thoughts I am still interested... esp local admin rights... Glenn |
||||||||
|
|
|||||||
The problem with the system not removing the folder can be solved in other ways. Most uninstall software will not remove files that have customized settings, and thus will not remove the folder. Doing this in a login script is bad, whether local users are admins or not. It's an admin task, and should be done by an administrator. Here's how to clone yourself to do this - 1. Modify your script to check the folder - If Exist('C:\Progra~1\Trend...') ; delete the folder and all contents EndIf 2. Create a folder on an accessible share somewhere and put Kix32.exe and your uninstall script and EXE there. 3. Test the script on a PC by running \\server\share\folder\kix32 \\server\share\folder\remove-it.kix from a command prompt. Make sure the SHELL command is "\\server\share\folder\remove.exe" (Change the script and EXE names as appropriate!) When step 3 works, you can now step behind the curtain and perform your magic - push the command to all computers to run at a scheduled time, using Admin credentials! It's quite simple..
Using the task scheduler is one of the best, safest, and most reliable methods of performing admin tasks on many computers. tsAdm has been around for a long time, and I use it regularly to perform tasks such as this. It is built on the tcLib UDF library, which is also available on my site. Glenn |
||||||||
|
|
|||||||
I will check it out - Thanks again for your help! I don't want to be a programmer but i can see that this could be very beneficial! |
||||||||
|
|
|||||||
You might find my Intro to Programming helpful - I use it when teaching admin scripting classes. The material is fairly generic, but it uses Kix for the exercises. Kix is the ideal administrators scripting language, since it has so many commonly needed capabilities built in, is syntactically forgiving, and has a wealth of pre-written UDFs. Glenn |