Crie um serviço para iniciar EXE ou script

1

Como posso criar um serviço que inicia com o Windows para executar um arquivo EXE ou um VBScript antes do login do Windows?

Eu estou perguntando isso porque eu tentei executar um VBScript no cronograma de tarefas enquanto o Windows está desconectado e não funcionou mesmo tho eu tentei convertê-lo para EXE que mencionei em outro segmento anterior aqui

    
por Elie 19.03.2017 / 21:02

1 resposta

3

Por meio de Microsoft - Como criar um usuário- Serviço Definido

To create a Windows NT user-defined service, perform the following steps:

  1. At a MS-DOS command prompt(running CMD.EXE), type the following command: path\INSTSRV.EXE My Service path\SRVANY.EXE where path is the drive and directory of the Windows NT Resource Kit (i.e., C:\RESKIT) and My Service is the name of the service you are creating.

    • Example: C:\Program Files\Resource Kit\Instsrv.exe Notepad C:\Program Files\Resource Kit\Srvany.exe
    • NOTE: To verify that the service was created correctly, check the registry to verify that the ImagePath value under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\service name is set to point to SRVANY.EXE. If this is not set correctly, the service will stop shortly after it starts and return an Event ID 7000 "The service name failed to start."
  2. Run Registry Editor (Regedt32.exe)and locate the following subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<My Service>

  3. From the Edit menu, click Add Key. Type the following and click OK: Key Name: Parameters Class : <leave blank>

  4. Select the Parameters key.

  5. From the Edit menu, click Add Value. Type the following and click OK: Value Name: Application Data Type : REG_SZ String : <path>\<application.ext> where <path>\<application.ext> is the drive and full path to the application executable including the extension (i.e., C:\WinNT\Notepad.exe)

  6. Close Registry Editor.

By default, a newly created service is configured to run Automatically when the system is restarted.

    
por 20.03.2017 / 00:26