Jump to content
Pulseway 9.14 🔥

Featured Replies

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

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)

  • Author

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

  • Author

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

 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.

  • Author

Will do so then. Thank you so much for your time and sorry for flooding you with questions!

Create an account or sign in to comment