Batch to locate service with special character

Asked

Viewed 371 times

3

I am trying to make a bat to connect a Windows service that has special character "Ç", but I could not reach any viable code. Always returns me error 1060.

That’s kind of the structure of my bat:

SC QUERY "Serviço Bonjour" > NUL
IF ERRORLEVEL 1060 GOTO MISSING_BONJOUR
ECHO Configurando AutoStart do Bonjour...
sc config "serviço do bonjour" start=auto
sc start "serviço do bonjour"
GOTO END

In the example above I have tried several other mechanisms, including substring, but I have not succeeded

2 answers

3


As per your command you’re picking up hair "NOME_PARA_EXIBITION", but if you catch it by "NOME_DO_SERVION" will have no problem.

Example:

NOME_DO_SERVION: DPS

NOME_PARA_EXIBITION: Servicthe Diagn Directive Directiveostic

Thus resulting in the command below to start the service:

sc config "DPS" start=auto
sc start "DPS"
  • Thank you, that was it!

0

Once I had to make a bat to configure network card, I know nothing, but I copy well hehe. I had problems with accentuation and found that you need to exchange these characters for another, follows a list. This is the way.

Citation

á=

à=...

ã=Æ

¡=

â=cadel

A=µ

À=

A=Ç

Ä=Ž

Â=

is=

è=Š

ë=

ê=ˆ

IS=

È=Ô

Ë=Ó

Ê=Ò

i=

ì=

ï=

î=Œ

Í=Ö

Ì=Þ

Ï=Ø

Î=

ó=

ò=•

õ=ôn

ö="

ô="

Ó=à

Ò=ã

Õ=å

Ö=™

Ô=â

lone = £

pow=-

ü=

alright=-

Ú=é

Ù=ë

Ü=š

Û=ê

ç=‡

Ç=€

§=õ

¹=ġ

²=ý

³=ü

£=œ

º=§

ª=

º=ø

Citation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.