This command configures the test agent to run as a service. Syntax- TestAgentConfig.exe configureAsService /userName: /password: ...

This command configures the test agent to run as a service.

Syntax-
TestAgentConfig.exe configureAsService [/userName:] 
         [/password:] [/port:]
         [/testController:] [/AgentUri:]
         [/currentProcessUserPassword:]
         [/LabServiceUserName:] 
         [/LabServiceUserPassword:]
         [/RemoveLabServiceUser]

userName                    User account under which test agent process will 
                            run. Default is the currently logged in user.
                    
password                    User account password. You will be prompted for 
                            password if you do not provide one. 
                    
testController              URI of the test controller with which this test 
                            agent will be registered. Specify a blank value
                            to unregister from the current test controller.
                    
agentUri                    Agent Uri if machine is already registered on the 
                            Team Foundation Server.
                    
port                        Port on which this test agent will listen for 
                            request from the test controller. Default port 
                            is 6910.
                    
CurrentProcessUserPassword  Password of the user account under which test agent 
                            process is currently running. It is required for 
                            cleaning up of startup programs.

RemoveLabServiceUser        Removes the lab service user account configuration 
                            
LabServiceUserName          User account to be used as labservice user account.

LabServiceUserPassword      Password of the specified labservice user account. 

Examples:
TestAgentConfig.exe configureAsService

TestAgentConfig.exe configureAsService /userName:domain\user /password:userPassword /port:6910 /testController:"MyController:6901"