2

For whatever reason the company who installed this service used the same name for the display and the service name.

Which is this format (not exact wording to protect them)

"Blah® Blah™ Agent Service"

When I look at the properties of the service from the gui it shows both for display and service.

If I look at the service name from command line it shows this

"Blahr BlahT Agent Service"

However when I use the latter in a command line or bat, windows says invalid service.

If I copy and paste the name with symbols into a notepad with net stop in front of it and convert to bat file I get the same error.

So my question is how can I stop this service due to it having some symbols in the display and service name?

Thanks in advance!

Daniel
  • 21
  • 2
  • 2
    Have you tried single quotes around the service name? – Davidw Jul 27 '18 at 02:21
  • I tried double quotes and no quotes at all. Should I try - net stop 'Blahr BlahT Agent Service' ? – Daniel Jul 27 '18 at 02:24
  • Do or do not, there is no try. – Davidw Jul 27 '18 at 02:31
  • 2
    You might also try the Powershell counterpart. – Davidw Jul 27 '18 at 02:33
  • If you copy and paste from the GUI directly to the command line, does it work? In the case of a batch file, you might need to take steps to ensure the batch file is appropriately encoded, probably UTF-16. – Harry Johnston Jul 27 '18 at 02:33
  • just tried both. With single quotes it tells me my syntax is wrong. – Daniel Jul 27 '18 at 02:34
  • @HarryJohnston ok! so copying from gui and pasting in command line works with double quotes. When I paste it replaces the registered mark with an r and the Trademark with a T. So is this an encoding issue with notepad? – Daniel Jul 27 '18 at 02:41
  • Sounds like it. Might be worth trying notepad++ or another third-party text editor. Or even Wordpad might work, I suppose. You'll probably need to use Save As and explicitly specify a suitable encoding. – Harry Johnston Jul 27 '18 at 02:46
  • alright so I copied the name from gui, placed in notepad ++ and have tried all these encodings. ANSI, UTF-8, UTF-8-BOM, UCS-2 BE BOM, UCS-2 LE BOM. None of these worked. What would the encode be? – Daniel Jul 27 '18 at 02:55
  • 1
    Darn, looks like batch files don't support Unicode, see the [first comment under this answer](https://stackoverflow.com/a/28413570/886887). Try Powershell instead, as @Davidw suggested. (Or you could try to find a code page that supports the particular characters you need.) – Harry Johnston Jul 27 '18 at 02:57

0 Answers0