The WASService command line tool lets you create a Windows service for any WebSphere Application Server Java process.
When the installation wizard creates a Windows service, the uninstaller program can remove the Windows service. If you use the WASService command to create a service yourself, it is your responsibility to remove the service when it is no longer valid. The uninstaller program does not remove Windows services that you create with the WASService command.
The WASService.exe command file is located in the install_root\bin directory.
WASService.exe command syntax for starting an existing service
WASService.exe [-start] "service_name" [optional startServer.bat parameters]
WASService.exe command syntax for creating a service or updating an existing service
WASService.exe -add "service_name" -serverName server -profilePath server_profile_directory [-wasHome install_root] [-configRoot configuration_repository_directory] [-startArgs additional_start_arguments] [-stopArgs additional_stop_arguments] [-userid user_id -password password] [-logFile service_log_file] [-logRoot server_log_directory] [-restart true | -restart false] [-startType automatic | manual | disabled]
WASService.exe command syntax for deleting a service
WASService.exe -remove "service_name"
WASService.exe command syntax for stopping a running service
WASService.exe -stop "service_name" [optional stopServer.bat parameters]
WASService.exe command syntax for retrieving service status
WASService.exe -status "service_name"
WASService.exe command syntax for encoding parameters
WASService.exe -encodeParams "service_name"
Supported arguments include:
WASService -encodeParams service_name
The name of the Windows service that is created by the Installation wizard is IBM WebSphere Application Server V6 - DefaultNode.
To view Windows services, open the Control panel and click Administrative Tools > Services. Select a service to view information about it. Right click the service and click Properties. Four tabs provide information and functionality. For example, select the Setup type field on the General tab to change the setup type.
Creating an Application Server service
WASService -add server2 -servername server2 -profilePath "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile" -wasHome "C:\Program Files\IBM\WebSphere\AppServer" -logfile "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\logs\startNode.log" -logRoot "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\logs" -restart true
Adding Service: server2 Config Root: C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\config Server Name: server2 Profile Path: C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile Was Home: C:\Program Files\IBM\WebSphere\AppServer\ Start Args: Restart: 1 IBM WebSphere Application Server V6 - server2 service successfully added.
Updating an existing Application Server service
This example updates an existing service called IBM WebSphere Application Server V6 - server2 with additional stop arguments, username and password. The user name and password are required by the stopServer command to stop the application server with security enabled.
WASService -add server2 -servername server2 -profilePath "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile" -stopArgs "-username user_name -password password" -encodeParams
Because server1 is registered to run as a Windows Service, the request to start this server will be completed by starting the associated Windows Service.
Stopping a server after enabling security
Could not stop the IBM WebSphere Application Server V6 - server_name service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error. If the problem persists, contact your system administrator.
The problem is due to the service control of the process. You must change the service to use the proper stop-server arguments for a secure server.
Use the -stopArgs parameter and the -encodeParams parameter to update the service as described in the "Updating an existing application server service" example.
Related tasks
Automatically restarting server processes
Related reference
Access problems after enabling security