Foro de elhacker.net

Sistemas Operativos => Windows => Mensaje iniciado por: Unix_Sendin en 23 Mayo 2015, 07:27 am



Título: Problema con SC en win7
Publicado por: Unix_Sendin en 23 Mayo 2015, 07:27 am
tengo el siguiente problema trato de un programa hacerlo un servicio en cmd ejecutado como administrador pongo esto:

Código:
sc create ezproxy binpath=C:\Program Files (x86)\ezProxy\ezEngine.exe type=interact type=own start=auto displayname="Proxy"

I cuando le doy me sale esto

Código:
C:\Windows\system32>sc create ezproxy binpath=C:\Program Files (x86)\ezProxy\ezEngine.exe type=interact type=own start=auto displayname="Proxy"
DESCRIPTION:
        Creates a service entry in the registry and Service Database.
USAGE:
        sc <server> create [service name] [binPath= ] <option1> <option2>...

OPTIONS:
NOTE: The option name includes the equal sign.
      A space is required between the equal sign and the value.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>

C:\Windows\system32>

Alguien me puede ayudar como crear un servicio.

Saludos Unix.


Título: Re: Problema con SC en win7
Publicado por: Eleкtro en 23 Mayo 2015, 11:44 am
Cómo esperas que funcione, no se pueden delimitar correctamente los argumentos, es decir, debes encerrar la ruta que contiene espacios en el valor del parámetro binpath.
Código:
binpath="C:\Program Files (x86)\ezProxy\ezEngine.exe"

...De hecho, para seguir buenas prácticas, deberías encerrar todos los argumentos ya contengan espacios o no (cómo has hecho con el último argumento) .

Saludos!


Título: Re: Problema con SC en win7
Publicado por: Unix_Sendin en 23 Mayo 2015, 18:44 pm
Hola gracias por responderme pues le cuento con con comillas o sin ellas me da el mismo error

Código:
C:\Windows\system32>sc create ezproxy binpath= "C:\Program Files (x86)\ezProxy\ezEngine.exe" type=interact type=own start=auto displayname="Proxy"
DESCRIPTION:
        Creates a service entry in the registry and Service Database.
USAGE:
        sc <server> create [service name] [binPath= ] <option1> <option2>...

OPTIONS:
NOTE: The option name includes the equal sign.
      A space is required between the equal sign and the value.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>

Algun otra propuesta Saludos.


Título: Re: Problema con SC en win7
Publicado por: Eleкtro en 24 Mayo 2015, 05:59 am
Pues a mi me funciona correctamente:

Citar
sc create ezproxy binpath= "C:\Program Files (x86)\ezProxy\ezEngine.exe" type=interact type=own start=auto displayname="Proxy"
[SC] CreateService CORRECTO

Qué extraño :-\.

¿Qué versión de Windows estás utilizando?.

EDITO: Ya me dí cuenta del motivo:

Aparte de la necesidad de encerrar los argumentos con espacios (esto es una regla general), en tu versión de Windows al parecer es necesario dejar un espacio entre el símbolo "=", cómo te está indicando el error:
Citar
NOTE: The option name includes the equal sign.
A space is required between the equal sign and the value.

Esto te debería funcionar:
Código:
SC.exe Create "ezproxy" binpath= "%ProgramFiles(x86)%\ezProxy\ezEngine.exe" type= "interact" type= "own" start= "auto" displayname= "Proxy"

Ten en cuenta que la sintaxis de muchos comandos tienen sus diferencias entre las distintas versiones de Windows, yo lo testeé bajo Windows 8.1.

Saludos!


Título: Re: Problema con SC en win7
Publicado por: Unix_Sendin en 25 Mayo 2015, 00:18 am
Yo Windows 7 Ultimate.

Saludos.