Re: Check if a service is installed
From: Brian Vallelunga (bgvallelunga_at_starpower.net)
Date: 08/18/04
- Next message: Ray at <%=sLocation%> [MVP]: "Re: Report total file size"
- Previous message: Kody Brown: "Re: Creating Home Directories"
- In reply to: Kody Brown: "Re: Check if a service is installed"
- Next in thread: Viatcheslav V. Vassiliev: "Re: Check if a service is installed"
- Reply: Viatcheslav V. Vassiliev: "Re: Check if a service is installed"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 17 Aug 2004 22:55:47 -0400
That definitely helps in figuring out how to run the command to install or
uninstall the service, thanks. Just identifying a file though is
insufficient for determining if a service exists. I'll keep looking. At
least part of the problem is solved.
Brian
"Kody Brown" <kody@noway.com> wrote in message
news:%23GC$MqKhEHA.1724@tk2msftngp13.phx.gbl...
> Maybe this will help?
>
> I have run into this before with registered DLL's. I check if the file
> exists, then call "regsvr32 /u dllname" using the WScript.Shell object.
> Once, it was unregistered, I would copy the newer file and register and/or
> start it..
>
> Dim filename : filename = "C:\Program Files\MyDir\myfile.dll"
> Dim sourcefile : sourcefile = "D:\source\myfile.dll"
> Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
> Dim objShell : Set objShell = WScript.CreateObject("WScript.Shell")
>
> If objFSO.FileExists(filename) Then
> objShell.Run "regsvr32.exe /U " & filename
> objFSO.CopyFile sourcefile, filename
> End If
>
> objShell.Run "regsvr32.exe " & filename
>
>
> You can control some services through the NET command, also...
>
> objShell.Run "net " & servicename & " stop"
> objShell.Run "net " & servicename & " start"
>
>
> This is from memory, hopefully, it is accurate!
>
> --
> -Kody
> kody at weekendtech dot net
> "Custom ASP.Net Web Controls"
>
>
>
> "Brian Vallelunga" <bgvallelunga@starpower.net> wrote in message
> news:O9$T43HhEHA.1644@tk2msftngp13.phx.gbl...
>> I'm totally new to scripting and I want to create a very simple script
> that
>> does the following:
>>
>> 1) Checks if a service is installed.
>> 2) Uninstalls the service if it is.
>> 3) Installs a new instance of the service.
>> 4) Starts the service.
>>
>>
>> I'm reading up, but don't have a clue where to start. Installing and
>> uninstalling the service are very simple tasks using just the command
>> line
>> "installutil" program. I'm not even sure how to go about calling this.
>>
>> Pointers to resources and / or code would be greatly appreciated.
>>
>> Thanks,
>>
>> Brian
>>
>>
>
>
- Next message: Ray at <%=sLocation%> [MVP]: "Re: Report total file size"
- Previous message: Kody Brown: "Re: Creating Home Directories"
- In reply to: Kody Brown: "Re: Check if a service is installed"
- Next in thread: Viatcheslav V. Vassiliev: "Re: Check if a service is installed"
- Reply: Viatcheslav V. Vassiliev: "Re: Check if a service is installed"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|