This article was previously published under Q252340
This article has been archived. It is offered "as is" and will no longer be updated.
This article describes how to create and start a service remotely on a Windows NT-based or Windows 2000-based computer from the command line.
In this scenario, the program file resides on all the remote computers; you want to write a script to create and start the service automatically.
The Netsvc.exe and Instsrv.exe tools from the Resource Kit do not create a service on a remote computer. The Srvinstw.exe tool from the Resource Kit is a program that you use to create remote services, but it is not a command-line tool that you can use in a script.
To create a script to create and start a service on a remote computer, use the Sc.exe tool from the Resource Kit. The syntax for this utility is:
sc \\computername create notepad binpath= c:\winnt\system32\notepad.exe type= own start= auto depend= "+TDI Netbios"
This particular command instructs the remote computer to create the "Notepad" service, then tells the computer where it can find the program file for this service.
The start=auto option instructs the computer to start the new Notepad service automatically when the computer is booted. The depend="+TDI Netbios" option tells the computer that it is dependent on the TDI group and on the NetBIOS service. Note that you must add quotation marks around the list of space-separated dependencies.
For more detailed information about the Sc.exe tool, please see the Sc-dev.txt file located in the Resource Kit.
Microsoft Windows NT Server 4.0, Terminal Server Edition Service Pack 4, Microsoft Windows NT Server 4.0, Terminal Server Edition Service Pack 5, Microsoft Windows 2000 Server, Microsoft Windows 2000 Advanced Server, Microsoft Windows 2000 Professional Edition, Microsoft Windows NT Server 4.0 Standard Edition