STAR*NET Ultimate can be launched to perform a specific adjustment using Windows task scheduler.
This can be valuable for a number of reasons:
- A STAR*NET adjustment can be configured so that it runs as a regularly scheduled task at a set schedule
- It may be necessary to run STAR*NET in a specific user account. Using Windows task scheduler and a batch file allows this configuration.
See below a guide showing how to run the example project found in: .\Documents\MicroSurvey\StarNet\ExamplesTutorial01-Trav2D.snproj using the Auto Adjust option:
- We've added an additional step that allows you to trigger the scheduled task using a batch file.
Step 1: Create the Scheduled Task
hit the Windows key and type Task Scheduler and click on the icon that appears in the search results (taskschd.msc).
Right click on "Task Scheduler Library" and select Create Task (not "Create Basic Task").
On the General tab:
Name: STARNET_Adjustment
Description: Runs STAR*NET adjustment
Select Run whether user is logged on or not
NOTE: This is important when you need STAR*NET to run in a separate user account. Permissions may need to be adjusted.
Check Run with highest privileges if needed.
Optional: Click Change User or Group... and select the user account you need this to run in
NOTE: STAR*NET must have been run once in this User account and license credentials manually entered
Click OK.
NOTE: You will be prompted for account credentials for the chosen User or User Group if you have selected an account other than the one you are working in. If you see an error message, permissions may need to be adjusted.
Step 2: Add a Dummy Trigger
Task Scheduler generally requires at least one trigger.
Go to Triggers.
Click New.
Set:
Begin the task: On a schedule
NOTE: In this example we're going to use a batch file to trigger the task, but if you wish you can set a schedule for running the task and skip to Step 3 in this guide:
One-time date far in the future (for example January 1, 2099)
Enabled: Yes
The task will never naturally run, but it can still be started manually.
Step 3: Configure the Action
Go to Actions.
Click New.
Set:
Action: Start a Program
Program/script: C:\Program Files\MicroSurvey\StarNet XX\StarNet.exe
...(where XX = Version)
Add arguments: "Tutorial01-Trav2D.snproj" /AUTOADJUST 3 1 15
Start in: (Required) C:\Users\<Your login>\OneDrive - Hexagon\Documents\MicroSurvey\StarNet\Examples
Step 4: Modify Settings
On the Settings tab I recommend enabling:
Allow task to be run on demand
Run task as soon as possible after a scheduled start is missed
If the task is already running, then the following rule applies:
Do not start a new instance
Step 5: Test the Task
In Task Scheduler:
Right-click the task.
Select Run.
Verify that STAR*NET launches and performs the adjustment by looking at the timestamps of the Tutorial01-Trav2D.lst file or look for a newly created Tutorial01-Trav2D.run file
NOTE: allow 2 minutes for updates
Additional Option: Triggering the Scheduled task using a batch file:
Create a new text document
Name it "Test Scheduled task.bat"
Include the following instructions in the batch file:
schtasks /run /tn "STARNET_Adjustment"
Save the text file. Double click to run the batch file and verify that the adjustment is run by:
- enter "Ctrl + Shift + Esc" and check that STAR*NET appears in the "Background processes" section of task manager
- verify that the timestamps of the .lst and .run files updates about 2 minutes after triggering the task
FULTON Kiera
Comments