The Open File dialog starts in the current directory set by your operating system. When you launch TestStand, there are several files that are loaded from <TestStand> directory. This causes Windows to set the current directory to be <TestStand>. You can change the current directory by calling the SetCurrentDirectoryA() function inside of kernel32.dll Windows dll. You could call this function from FrontEndCallbacks sequence file since it executes every time you launch TestStand. Follow these steps to accomplish this:
- Open the FrontEndCallbacks.seq sequence file from <TestStand Public>\Components\Callbacks\FrontEnd\
- If the FrontEndCallbacks.seq file is empty, please replace it with a copy from <TestStand>\Components\Callbacks\FrontEnd, otherwise proceed to step 3. You should never modify the default TestStand files; always use a copy instead.
- Select the LoginLogout sequence from the Sequences pane.
- Select the C/C++ DLL adapter as the default adapter.
- Insert an Action step above the Logout step. Name the new step Set Current Directory.
- Right-click on the Set Current Directory step and select Specify Module... from the popup menu.
- Enter kernel32.dll as the Module path.
- Select SetCurrentDirectoryA from the Function ring control.
- You may see a dialog box that notifies you that "This function does not have parameter information in the DLL or uses types not recognized by TestStand". Select OK.
- Click the Add button to create a new parameter.
- Enter CurrentDirectory for the parameter name, replacing the default arg1.
- Choose String for the Category and C String (const) for Type.
- Enter the directory you want as you initial directory in the Value Expression text box. Make sure to enclose this in double quotes and use double back slashes in your path (e.g.
C:\\Temp\\MyDirectory
).
- Save the FrontEndCallbacks.seq file.
- copy from <TestStand>\Components\Callbacks\FrontEnd the folder WIN32 and paste it into folder <TestStand Public>\Components\Callbacks\FrontEnd\
Now when you launch TestStand and select File»Open File..., your initial path will be the one you selected.
Additional Information
<TestStand> refers to TestStand installation directory.
<TestStand Public> refers to TestStand Public directory.
Please refer to TestStand Directory Structure help page for default paths.