Automate a Selent Trend Micro OfficeScan Uninstall Batch File

I have recently updated a Windows 2003 32bit Trend Micro server to 64bit Windows 2008 and had to uninstall Trend OfficeScan from approximately 200 servers. Rather than go through each one individually, I created the following batch file to remove Trend Micro for me.

As you can see it first stops the Trend Services before deleting them. It then adds the ability to uninstall OfficeScan into the registry. Once this is done, we can run the Uninstall command.

    @echo on  
    echo ~~~ This will uninstall Trend Micro program and Services ~~~

    net stop ntrtscan
    net stop tmlisten
    net stop tmProxy    
    sc delete ntrtscan
    sc delete tmlisten
    sc delete tmProxy
    reg add HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc. /v "Allow Uninstall" /t REG_DWORD /d 1 /f
    "C:\Program Files\Trend Micro\OfficeScan Client\ntrmv.exe"

Once I had my uninstall script, I was ready to push it out with PSTools PSExec command.

    psexec -n 20 @2003servers.txt -u user -p password cmd /c \\NFSShare\Batchfiles\trend-uninstall.bat

This took a while as it had a lot of servers to go through. I was actually pretty impressed with the uninstaller. It cleans up after itself pretty well, much better than Norton. The next day, I was able to run the following command to install Trend officescan on all of the servers.

    psexec -n 20 @2003servers.txt -u user -p password cmd /c \\trendserver\ofscan\autopcc.exe