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

New-Service Options (Interact with desktop)

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-09-2008   #1 (permalink)
greatbarrier86
Guest


 

New-Service Options (Interact with desktop)

Hi,

How can i get powershell's "New-Service" to automatically check the setting
that interacts with the desktop?

So far, i have
new-Service -name ServiceName -binaryPathName "PathHere" -displayName
"MyService" -startupType Automatic

My System SpecsSystem Spec
Old 01-09-2008   #2 (permalink)
Kirk Munro [MVP]
Guest


 

Re: New-Service Options (Interact with desktop)

After you create your service, retrieve it with Get-WmiObject and set the
DesktopInteract property accordingly.

i.e.
New-Service -Name ServiceName -BinaryPathName "PathHere" -DisplayName
"MyService" -StartupType Automatic
(Get-WmiObject -Class Win32_Service -Filter
"name='ServiceName'").DesktopInteract = $true

--
Kirk Munro [MVP]
Poshoholic
http://poshoholic.com


"greatbarrier86" <greatbarrier86@xxxxxx> wrote in message
news:E06523E5-EDB6-4CE5-8EBA-025A3A0C8D7C@xxxxxx
Quote:

> Hi,
>
> How can i get powershell's "New-Service" to automatically check the
> setting
> that interacts with the desktop?
>
> So far, i have
> new-Service -name ServiceName -binaryPathName "PathHere" -displayName
> "MyService" -startupType Automatic

My System SpecsSystem Spec
Old 01-10-2008   #3 (permalink)
greatbarrier86
Guest


 

Re: New-Service Options (Interact with desktop)

Thanks Kirk! That worked well!

"Kirk Munro [MVP]" wrote:
Quote:

> After you create your service, retrieve it with Get-WmiObject and set the
> DesktopInteract property accordingly.
>
> i.e.
> New-Service -Name ServiceName -BinaryPathName "PathHere" -DisplayName
> "MyService" -StartupType Automatic
> (Get-WmiObject -Class Win32_Service -Filter
> "name='ServiceName'").DesktopInteract = $true
>
> --
> Kirk Munro [MVP]
> Poshoholic
> http://poshoholic.com
>
>
> "greatbarrier86" <greatbarrier86@xxxxxx> wrote in message
> news:E06523E5-EDB6-4CE5-8EBA-025A3A0C8D7C@xxxxxx
Quote:

> > Hi,
> >
> > How can i get powershell's "New-Service" to automatically check the
> > setting
> > that interacts with the desktop?
> >
> > So far, i have
> > new-Service -name ServiceName -binaryPathName "PathHere" -displayName
> > "MyService" -startupType Automatic
>
>
>
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop does not load after login Options Victor Vista General 5 3 Weeks Ago 11:27 PM
Vista Desktop Wallpaper Fit options, I thought there were 5 options? lersince1991 General Discussion 5 08-26-2008 07:40 PM
Run my program with the system account interact with desktop Greta Vista security 0 01-17-2008 05:57 AM
Allowing service to interact with desktop using New-Service greatbarrier86 PowerShell 7 11-08-2007 11:56 AM
Service interact with desktop zion Vista security 4 06-26-2007 04:46 AM


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