How to Run an Application on Windows Startup


Purpose of this article

This article aims to show you how to configure the Windows to execute the project runtime or the remote Viewer during startup.

Configurations to execute the project runtime on Windows startup

This document will show how to configure the Windows to execute the project runtime or the remote Viewer during startup.

  1. Create a shortcut for your project.

The shortcut file will be created in the desktop, get the path where it is and save it for later.

  1. To configure the Windows startup it is necessary to create a batch file with the commands to run a program.
  1. Open a text editor (In this example we are going to use a Notepad).
  1. Write the following commands.

@echo off prevents the prompt and contents of the batch file from being displayed, so that only the output is visible.

The @ makes the output of the echo off command hidden as well.

:: allows you to write any comments if needed. You can also skip this line.

start executes any program. In our example, we want to start the runtime, so in the second parameter, we can either call the Runtime.exe + an extra parameter containing the .prj path or use directly the shortcut as in the example above. The initial double quotes is mandatory and it can contain a title to the CMD dialog, but it is recommended to leave it empty.

  1. Save the file, but instead of saving as .txt write it as .bat The file will have the following appearance.
  1. Add the file to the Windows startup folder.
  1. Press the Windows key+R to open the Run window.
  1. Write “shell:common startup” and press OK to open the Windows startup folder.
  1. The Windows startup folder will open, copy the BAT file created and add to the folder.
  1. Now shut down and turn on the computer to test if it is working.

Configuring Windows Startup with Remote Viewer

  1. Search for the IP and port the remote Viewer will use. In this example we are going to use the current machine IP and the default port, but you are able to decide which you will use.
  1. You may find the IP and port executing the remote viewer inside the “…\ADISRA\Adisra SmartView\Bin”. The following screen will appear.
  1. Save the IP and port for later use and disable “Save configuration” if it is enabled. To see or configure the port the project is using, go through Viewer Settings.
  1. Create a Batch (BAT) file. To configure the Windows startup it is necessary to create a batch file with the commands to run a program.
  1. Open a text editor (In this example we are going to use a Notepad).

@echo off

  1. Write the following commands.

:: Execute shortcuts or programs

start “” “C:\Program Files (x86)\ADISRA\Adisra SmartView\Bin\Viewer.exe” “127.0.0.1” “9000” “false”

The parameters after the remote viewer path includes the machine IP, the port the viewer will use and the last one decides whether the remote viewer screen will open or not.

  1. Save the file, but instead of saving as .txt write it as .bat.
  1. Add the file to the Windows startup folder
  1. Press the Windows key+R to open the Run window
  1. Write “shell:common startup” and press OK to open the Windows startup folder.
  1. The Windows startup folder will open, copy the BAT file created and add to the folder.
  1. Now shut down and turn on the computer to test if it is working.