NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

c# program needs to login automatically and run a sequnce file!

I am trying write a program that launches the c# testexec.exe user interface with command line parameters like this: 'testexec /run MainSequence "{sequence path\filename}" /quit'.  I don't want to use the windows user name that is logged on to windows as the automatic logon because I would need to maintain each user inside teststand.  Is there someway I can modify testexec.exe to pass the user name and password and avoid the logon dialog box?
0 Kudos
Message 1 of 2
(3,478 Views)
Hey Terry,

What you are wanting to do is possible with the following method:
  • You can automatically log the user in by setting the Engine.CurrentUser equal to some user (by using Engine.GetUser(string user name)). 
  • Configure two properties for the Application Manager: LoginOnStart = false, ProcessCommandLine = true. 
  • After the application manager start method, add a call to ApplicationManager.Login().
  • In the FrontEndCallbacks sequence, add a condition for the Login step that checks if Engine.CurrentUser == Nothing.  That is, if a user is already logged in, do not prompt the user with a dialog.
These settings combined with the property ApplicationManager.CommandLineArguments (providing you with the user name and password to use) should yield you a solution.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 2 of 2
(3,455 Views)