Need script to run msiesec, remove service,delete files. and delete regkey.

I need a VB script to run these commands in this order.
1. run msiexec /q /x  \\servername\sharename\dwmrcs.msi
2. must stop and remove service
  sc stop dwmrcs
  sc delete dwmrcs
3. delete these files from %systemroot%\system32
  dwrcs.exe
  dwrck.dll
  dwrcset.dll
  dwrcshell.dll
  dwrcs.ini
4. Delete Key "DameWare Development" from HLCU\software and HKLM\software.

This must all be done quiet with no output to the enduser. resumes on errors.

Thanks guys and girls
Jason
LVL 1
jasonlkennedyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobSampsonCommented:
What about a batch file:

@echo off
msiexec /q /x  \\servername\sharename\dwmrcs.msi
sc stop dwmrcs
sc delete dwmrcs
del /q /f %systemroot%\system32\dwrcs.exe
del /q /f %systemroot%\system32\dwrck.dll
del /q /f %systemroot%\system32\dwrcset.dll
del /q /f %systemroot%\system32\dwrcshell.dll
del /q /f %systemroot%\system32\dwrcs.ini
reg delete /f "HLCU\software and HKLM\software\DameWare Development"


Regards,

Rob.
0
RobSampsonCommented:
Oh, this:
reg delete /f "HLCU\software and HKLM\software\DameWare Development"

should be
reg delete /f "HLCU\software\DameWare Development"
reg delete /f "HKLM\software\DameWare Development"

Regards,

Rob.
0
hlarseCommented:
Here's how to make it silent.  Check out nircmdc.exe at www.nirsoft.net and include this at the top of your batch file

@echo off
cls
setlocal
cd /d c:\windows
if not exist "c:\windows\nircmd.exe" copy "\\server\share\nircmd.exe" >nul 2>nul
nircmdc.exe win min ititle cmd.exe
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

RobSampsonCommented:
Oh yeah, or you can use a VBS file to run the batch file silently too:

Set objShell = CreateObject("WScript.Shell")
strBatchPath = "C:\Temp\BatchFile.bat"
objShell.Run strBatchFile, 0, True

It's the zero there that hides the command window.

Regards,

Rob.
0
RobSampsonCommented:
Or, to even put the whole thing in one VBS (kind of cheating though, but why re-invent the wheel?):

'=====================
Set objShell = CreateObject("WScript.Shell")
strCommand = "msiexec /q /x \\servername\sharename\dwmrcs.msi"
objShell.Run strCommand, 0, True
strCommand = "cmd /c sc stop dwmrcs"
objShell.Run strCommand, 0, True
strCommand = "cmd /c sc delete dwmrcs"
objShell.Run strCommand, 0, True
strCommand = "cmd /c del /q /f %systemroot%\system32\dwrcs.exe"
objShell.Run strCommand, 0, True
strCommand = "cmd /c del /q /f %systemroot%\system32\dwrck.dll"
objShell.Run strCommand, 0, True
strCommand = "cmd /c del /q /f %systemroot%\system32\dwrcset.dll"
objShell.Run strCommand, 0, True
strCommand = "cmd /c del /q /f %systemroot%\system32\dwrcshell.dll"
objShell.Run strCommand, 0, True
strCommand = "cmd /c del /q /f %systemroot%\system32\dwrcs.ini"
objShell.Run strCommand, 0, True
strCommand = "cmd /c reg delete /f ""HLCU\software and HKLM\software\DameWare Development"""
objShell.Run strCommand, 0, True
Set objShell = Nothing
'===================

Regards,

Rob.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jasonlkennedyAuthor Commented:
Fast and accurate.. Thanks.
0
RobSampsonCommented:
Thanks for the grade.

Regards,

Rob.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.