Jump to content

Program restart on ending script


Basil62

Recommended Posts

  • Staff

Hi @Basil62,

Please try to modify this script to make sure that your application is always running.

@ECHO OFF

QPROCESS "notepad.exe" >nul 2>&1 && (
    echo process notepad.exe  is running
) || (
    notepad.exe
    echo process notepad.exe  is started
)

Note: If you will execute this script via Pulseway, then this application will be launched in the session zero with no GUI interface.

Therefore I would suggest you to create the scheduled task which will run on your system every minute and check if this process is running and start it if the process is not running (you may remove the echo statements from this script)

Link to comment
Share on other sites

Hello Chris and thank you for replying to my question. Just a followup, since this is the first time I actually associate with scripts. This is a Windows PowerShell script, right? To clarify, I am running Pulseway on Windows 10.

Edited by Basil62
Link to comment
Share on other sites

  • Staff

 If you will execute this script via Pulseway, then this application will be launched in the session zero with no GUI interface. Therefore I suggested you to use the Windows scheduler to make sure, that the TeamViewer.exe is running on your system at this time.

Another thing is - please use the full path for the executable and remove those echo statements.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...