0

I am trying to change the startup type of All services whose name start with 'Oracle' to Manual, I am using below code, but it' not working.

wmic service where "displayname like 'Oracle%'" call ChangeStartMode "Manual"

wmic service where "name like 'Oracle%' and  Startmode<>'Manual'" call ChangeStartmode Manual
James Z
  • 12,209
  • 10
  • 24
  • 44
Ganesh
  • 486
  • 3
  • 8
  • 18
  • 1
    You're running them fine, for the [tag:command-prompt], but in a [tag:batch-file] you need to double your **`%`** characters. – Compo Dec 05 '19 at 20:02
  • By running the script from the command prompt as well, startup type is not getting change. – Ganesh Dec 06 '19 at 01:33
  • `@"%__AppDir__%wbem\WMIC.exe" Service Where "DisplayName Like 'Oracle%%' And StartMode!='Manual'" Call ChangeStartMode Manual` will change the Start Mode of any services over which you have sufficient privileges, which have a Display Name beginning with the case insensitive string `Oracle` and which isn't already set to start Manually. My instinct is that your issue is with privileges, you cannot stop a service without the correct permissions. Try running the [tag:batch-file] 'As administrator' instead. Also when you run the command there should be a success or error output to help you. – Compo Dec 06 '19 at 11:48

0 Answers0