Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Can a service be registered via Powershell?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-12-2008   #1 (permalink)
Ross J. Micheals
Guest


 

Can a service be registered via Powershell?

Hello! I'm relatively new to Poweshell and could not find an answer to this
question via an Internet search or a search of this newsgroup. (Perhaps I'm
not using the most appropriate search terms.)

Given a file, SERVICE.SYS, how would one register that file with the Service
Control Manager via PowerShell?

Thanks!

-Ross



My System SpecsSystem Spec
Old 03-12-2008   #2 (permalink)
Marco Shaw [MVP]
Guest


 

Re: Can a service be registered via Powershell?

Ross J. Micheals wrote:
Quote:

> Hello! I'm relatively new to Poweshell and could not find an answer to this
> question via an Internet search or a search of this newsgroup. (Perhaps I'm
> not using the most appropriate search terms.)
>
> Given a file, SERVICE.SYS, how would one register that file with the Service
> Control Manager via PowerShell?
>
> Thanks!
>
> -Ross
>
>
We don't always recommend reinventing the wheel. There's a DOS utility
named sc.exe that should help.

PSH>sc.exe /?
PSH>sc.exe create /?

You're not really doing it *with* PowerShell...

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 03-12-2008   #3 (permalink)
Shay Levi
Guest


 

Re: Can a service be registered via Powershell?

You can with the New-Service cmdlet. It creates a new entry for a Windows
Service in the registry and the
Service Database. You can set the display name, description, startup type
and dependencies of the service.
BTW, I've never seen SYS files registered as a windows service.

Check the help for more info:

help New-Service -full

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> Ross J. Micheals wrote:
>
Quote:

>> Hello! I'm relatively new to Poweshell and could not find an answer
>> to this question via an Internet search or a search of this
>> newsgroup. (Perhaps I'm not using the most appropriate search terms.)
>>
>> Given a file, SERVICE.SYS, how would one register that file with the
>> Service Control Manager via PowerShell?
>>
>> Thanks!
>>
>> -Ross
>>
> We don't always recommend reinventing the wheel. There's a DOS
> utility named sc.exe that should help.
>
PSH>> sc.exe /?
PSH>> sc.exe create /?
Quote:

> You're not really doing it *with* PowerShell...
>
> Marco
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
> Blog:
> http://marcoshaw.blogspot.com

My System SpecsSystem Spec
Old 03-12-2008   #4 (permalink)
Oisin (x0n) Grehan [MVP]
Guest


 

Re: Can a service be registered via Powershell?

On Mar 12, 9:39*am, Shay Levi <n...@xxxxxx> wrote:
Quote:

> You can with the New-Service cmdlet. It creates a new entry for a Windows
> Service in the registry and the
> Service Database. You can set the display name, description, startup type
> and dependencies of the service.
> BTW, I've never seen SYS files registered as a windows service.
>
> Check the help for more info:
>
> help New-Service -full
>
> -----
> Shay Levi
> $cript Fanatichttp://scriptolog.blogspot.com
>
>
>
>
>
Quote:

> > Ross J. Micheals wrote:
>
Quote:
Quote:

> >> Hello! I'm relatively new to Poweshell and could not find an answer
> >> to this question via an Internet search or a search of this
> >> newsgroup. (Perhaps I'm not using the most appropriate search terms.)
>
Quote:
Quote:

> >> Given a file, SERVICE.SYS, how would one register that file with the
> >> Service Control Manager via PowerShell?
>
Quote:
Quote:

> >> Thanks!
>
Quote:
Quote:

> >> -Ross
>
Quote:

> > We don't always recommend reinventing the wheel. *There's a DOS
> > utility named sc.exe that should help.
>
> PSH>> sc.exe /?
> PSH>> sc.exe create /?
>
>
>
Quote:

> > You're not really doing it *with* PowerShell...
>
Quote:

> > Marco
>
Quote:

> > PowerGadgets MVP
> >http://www.powergadgets.com/mvp
> > Blog:
> >http://marcoshaw.blogspot.com- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
Hi Ross,

The file "service.sys" is most likely a *driver*, not a windows
service in the classic sense, although you could be forgiven for
thinking this; drivers are also known as "services" in certain
contexts. Drivers such as these are found in %systemroot%
\system32\drivers although just dropping the file in there is not
enough. If you find yourself with such a file, you are almost
certainly missing crucial parts (namely a setup.inf or other install
information) of the package.

What does this file supposedly do, why do you want to install it, and
where did you get it from?

Yours interrogatively,

- Oisin
My System SpecsSystem Spec
Old 03-12-2008   #5 (permalink)
Ross J. Micheals
Guest


 

Re: Can a service be registered via Powershell?

This is very helpful, thank you. I don't know why I hadn't found that myself.
As for it being a '.sys' file, I'm not sure either. I have documentation that
states "After installing the REDACTED.SYS driver it is necessary to add it as
a service. This need only be done once." I was just going by that
documentation.

Thanks again!


"Shay Levi" wrote:
Quote:

> You can with the New-Service cmdlet. It creates a new entry for a Windows
> Service in the registry and the
> Service Database. You can set the display name, description, startup type
> and dependencies of the service.
> BTW, I've never seen SYS files registered as a windows service.
>
> Check the help for more info:
>
> help New-Service -full
>
> -----
> Shay Levi
> $cript Fanatic
> http://scriptolog.blogspot.com
>
Quote:

> > Ross J. Micheals wrote:
> >
Quote:

> >> Hello! I'm relatively new to Poweshell and could not find an answer
> >> to this question via an Internet search or a search of this
> >> newsgroup. (Perhaps I'm not using the most appropriate search terms.)
> >>
> >> Given a file, SERVICE.SYS, how would one register that file with the
> >> Service Control Manager via PowerShell?
> >>
> >> Thanks!
> >>
> >> -Ross
> >>
> > We don't always recommend reinventing the wheel. There's a DOS
> > utility named sc.exe that should help.
> >
> PSH>> sc.exe /?
> PSH>> sc.exe create /?
Quote:

> > You're not really doing it *with* PowerShell...
> >
> > Marco
> >
> > PowerGadgets MVP
> > http://www.powergadgets.com/mvp
> > Blog:
> > http://marcoshaw.blogspot.com
>
>
>
My System SpecsSystem Spec
Old 03-12-2008   #6 (permalink)
Jon
Guest


 

Re: Can a service be registered via Powershell?

"Ross J. Micheals" <RossJMicheals@xxxxxx> wrote in
message news:F428ACC1-68C5-44BB-866F-68673F469A71@xxxxxx
Quote:

> This is very helpful, thank you. I don't know why I hadn't found that
> myself.
> As for it being a '.sys' file, I'm not sure either. I have documentation
> that
> states "After installing the REDACTED.SYS driver it is necessary to add it
> as
> a service. This need only be done once." I was just going by that
> documentation.
>
> Thanks again!
>


Advisable to check that documentation thoroughly, since if it's a driver
then it's likely to require a boot or system level startup, which you can't
do with New-Service.

--
Jon



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
when run powershell script as windows service ,powershell fail powershell fail on winodws 2008 PowerShell 6 01-15-2008 03:20 PM
get-service cmdlet in powershell v2 (ctp) RG PowerShell 3 12-14-2007 03:43 PM
PowerShell hangs while getting data from Web Service. Please Help. Raj Tripathi PowerShell 3 04-05-2007 12:42 PM
Using PowerShell to change service descriptions matt R PowerShell 1 03-27-2007 07:42 AM
Powershell Script as Windows Service tobias.kuhn@gmail.com PowerShell 5 02-08-2007 12:00 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51