Jump to content

Recommended Posts

Posted

I want a program to always run on my computer. Is there a script that forces a program to restart after its process has been stopped?

Thanks in advance

  • Staff
Posted

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)

Posted (edited)

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
Posted

Sorry for another follow up question. So only by making a .bat file? The Batch option, as shown in the screenshot, won't do?

sciprt.png

  • Staff
Posted

 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.

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...