Jump to content
Basil62

Program restart on ending script

Recommended Posts

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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

 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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By NadeCatcher
      Hello,
      I've been trying to turn on my computer when I'm away from the house using both mobile data and another WiFi connection. When I'm on the same network the wake up command works but if I'm using mobile data I'll get the message "Wake up command failed" and when I'm on another network it says "wake up command sent" but nothing happens. I have the necessary port forwarded (UDP 9) and through the Pulseway android app port monitor I can see it works. Any help would be greatly appreciated.
      Thanks
    • By General_Snuss
      I changed phones recently and the new app says:
      'This device is pending approval. Login to the WebApp and approve it from the account devices page.'
      If I got to https://my.pulseway.com/main/account/devices there is no device to approve.
      Am I doing something wrong?
    • By Brandan
      Here is a Batch script to empty the SoftwareDistribution Folder.  It stops any installer processes in the background, temporarily disables the Windows Update Service, deletes everything in the Software Distribution folder then sets the Windows update service back to automatic and starts the service.
      @echo off
      CD C:\
      taskkill /F /im setup.exe
      taskkill /F /im ose00000.exe
      taskkill /F /im msiexec.exe
      sc config wuauserv start= disabled
      net stop wuauserv
      PowerShell.exe Remove-Item C:\Windows\SoftwareDistribution\* -Force -Recurse
      sc config wuauserv start= demand
      net start wuauserv
    • By Louwrens
      Please expand the list of programs on 3rd Party Patch management.
      Some suggestions:
      Adobe Flash
      Amazon Corretto (Since Oracle Java is not free anymore)
      Dropbox
      Gimp
      Google Gsync (GSuite)
      K-lite Codec
      LibreOffice
      OpenVPN
      Thunderbird
      WhatsApp Desktop Client
       
       
       
    • By Andy Raybould
      Hi
      Could someone assist in helping me to set up an alert when a network connection is dropped.
      This is happening at one of my client sites after changing to a new ISP. The ISP says the router/switch is fine but connections are dropping.
      I would like to be able to log when a connection drops (ideally knowing if the internet connection has dropped or just the internal network connection)
      I'm not sure a simple ping notification is good enouh in Pulseway to do this as I need to know if the connection has dropped for a few mseconds as well as larger outages.
      I guess the Event Viewer holds the answers but would appreciate it if anyone has done this before if they could share their thoughts.
      Thank you, Andy
×
×
  • Create New...