SOLVED

How to disable/stop a task using Powershell CLI

%3CLINGO-SUB%20id%3D%22lingo-sub-1814282%22%20slang%3D%22en-US%22%3EHow%20to%20disable%2Fstop%20a%20task%20using%20Powershell%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1814282%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20run%20%22Get-ScheduledTask%22%20command%2C%20I%20found%20my%20PC%20is%20running%20this%20task%20%22Google%20Pinyin%20Daemon%20Running%22%2C%20I%20tried%20to%20stop%20it%20but%20failed%2C%20then%20I%20tried%20to%20disable%20it%20but%20still%20failed.%20Can%20someone%20suggest%20how%20to%20achieve%20my%20purpose%3F%20Thank%20you.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETask%20list%3A%3C%2FP%3E%3CP%3EC%3A%5CUsers%5C%26gt%3B%20Get-ScheduledTask%3C%2FP%3E%3CP%3ETaskPath%20TaskName%20State%3CBR%20%2F%3E--------%20--------%20-----%3CBR%20%2F%3E%5C%20Adobe%20Acrobat%20Update%20Task%20Ready%3CBR%20%2F%3E%5C%20Adobe%20Flash%20Player%20NPAPI%20Notifier%20Ready%3CBR%20%2F%3E%5C%20AdobeGCInvoker-1.0%20Ready%3CBR%20%2F%3E%5C%20Google%20Pinyin%20Daemon%20Running%3CBR%20%2F%3E%5C%20McAfeeLogon%20Ready%3CBR%20%2F%3E%5C%20OneDrive%20Standalone%20Update%20Tas...%20Ready%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5CUsers%5C%26gt%3B%20Set-Service%20-Name%20%22Google%20Pinyin%20Daemon%22%20-Status%20stopped%3CBR%20%2F%3ESet-Service%20%3A%20Service%20Google%20Pinyin%20Daemon%20was%20not%20found%20on%20computer%20'.'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20Set-Service%20-Name%20%22Google%20Pinyin%20Daemon%22%20-Status%20stopped%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(.%3AString)%20%5BSet-Service%5D%2C%20InvalidOperationException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20InvalidOperationException%2CMicrosoft.PowerShell.Commands.SetServiceCommand%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5CUsers%5CiMac%26gt%3B%20Set-Service%20-Name%20%22Google%20Pinyin%20Daemon%22%20-Status%20stopped%20-StartupType%20disabled%3CBR%20%2F%3ESet-Service%20%3A%20Service%20Google%20Pinyin%20Daemon%20was%20not%20found%20on%20computer%20'.'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20Set-Service%20-Name%20%22Google%20Pinyin%20Daemon%22%20-Status%20stopped%20-StartupTyp%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(.%3AString)%20%5BSet-Service%5D%2C%20InvalidOperationException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20InvalidOperationException%2CMicrosoft.PowerShell.Commands.SetServiceCommand%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1814282%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1815182%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20disable%2Fstop%20a%20task%20using%20Powershell%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815182%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F844195%22%20target%3D%22_blank%22%3E%40wordsbao%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDid%20you%20open%20the%20services%20and%20confirm%20that%20the%20service%20is%20really%20there%2C%20as%20it%20seems%20from%20the%20error%20from%20Powershell%2C%20the%20service%20does%20not%20exist%20or%20it%20has%20a%20different%20name.%26nbsp%3B%3C%2FP%3E%3CP%3Etry%20the%20following%3A%3C%2FP%3E%3CP%3Eopen%20the%20schedule%20task%20GUI%20and%20check%20the%20Action%2C%20and%20see%20what%20exactly%20this%20task%20is%20doing%2C%20maybe%20its%20starting%20an%20app%2C%20not%20a%20service.%3C%2FP%3E%3CP%3EKill%20the%20app.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1815424%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20disable%2Fstop%20a%20task%20using%20Powershell%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815424%22%20slang%3D%22en-US%22%3EThank%20you%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F790105%22%20target%3D%22_blank%22%3E%40farismalaeb%3C%2FA%3E%20.%20I%20opened%20it%20but%20don't%20see%20the%20service%20there.%20ANd%20I%20think%20I%20have%20deleted%20Google%20Pinyin%20from%20my%20computer%20long%20time%20ago.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1815538%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20disable%2Fstop%20a%20task%20using%20Powershell%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1815538%22%20slang%3D%22en-US%22%3ECan%20u%20post%20a%20screenshot%20of%20the%20schedule%20task%3C%2FLINGO-BODY%3E
New Contributor

Hi all,

 

When I run "Get-ScheduledTask" command, I found my PC is running this task "Google Pinyin Daemon Running", I tried to stop it but failed, then I tried to disable it but still failed. Can someone suggest how to achieve my purpose? Thank you. 

 

 

 

Task list:

C:\Users\> Get-ScheduledTask

TaskPath TaskName State
-------- -------- -----
\ Adobe Acrobat Update Task Ready
\ Adobe Flash Player NPAPI Notifier Ready
\ AdobeGCInvoker-1.0 Ready
\ Google Pinyin Daemon Running
\ McAfeeLogon Ready
\ OneDrive Standalone Update Tas... Ready

 

PS C:\Users\> Set-Service -Name "Google Pinyin Daemon" -Status stopped
Set-Service : Service Google Pinyin Daemon was not found on computer '.'.
At line:1 char:1
+ Set-Service -Name "Google Pinyin Daemon" -Status stopped
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.:String) [Set-Service], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.SetServiceCommand

 

PS C:\Users\iMac> Set-Service -Name "Google Pinyin Daemon" -Status stopped -StartupType disabled
Set-Service : Service Google Pinyin Daemon was not found on computer '.'.
At line:1 char:1
+ Set-Service -Name "Google Pinyin Daemon" -Status stopped -StartupTyp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (.:String) [Set-Service], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.SetServiceCommand

 

 

 

7 Replies

@wordsbao 

Did you open the services and confirm that the service is really there, as it seems from the error from Powershell, the service does not exist or it has a different name. 

try the following:

open the schedule task GUI and check the Action, and see what exactly this task is doing, maybe its starting an app, not a service.

Kill the app.

 

Thank you @farismalaeb . I opened it but don't see the service there. ANd I think I have deleted Google Pinyin from my computer long time ago.
Can u post a screenshot of the schedule task

Hi @farismalaeb 

 

Sorry for the delay, preparing for my RHCSA but still failed.

 

Capture.PNG 

Best Response confirmed by wordsbao (New Contributor)
Solution

@wordsbao 

Hi, 

What I actually want is check it from the GUI

1.png

Check the Action, is the destination file really exist or what, does the schedule start a service or start an executable.

if the schedule task starting an executable, it doesnt mean that it should be assigned to a service.

 

Thank you, @farismalaeb , I fount it there and deleted it. Appreciate all your help!

 

 

 

 

Thanks for the update
Glad ur problem is solved
Would u please click on Best Response
Thanks