Danny Agrippa Posted November 23, 2016 Posted November 23, 2016 Hi All, When a proces has been killed or not responding. I want to restart it with a script. Example: Icloud program stopped working (Proces named: icloud.exe) located C:\Program Files\Icloud\Icloud.exe. Now i make a script : "C:\Program Files\Icloud\Icloud.exe" If i run that script on the system it doesnt start icloud again. Is my script incorrect? Pulseway notify's me it was done succesfully but it didn't start. (Took 2 seconds) I also tested this with notepad: C:\Windows\System32\notepad.exe also this one didnt start up. Ill hope you guys can tell me what i'm doing wrong. Kind Regards, Danny
Administrators Paul Posted November 23, 2016 Administrators Posted November 23, 2016 Hi Danny, If you want to start a windows service you should use the "net start serviceName" command however if you want to start GUI applications in the console session you need to use PowerShell, setup the PowerShell impersonation in the Pulseway Manager app in the Settings -> Runtime tab and finally use Start-Job { C:\Windows\System32\notepad.exe } . -Paul
Danny Agrippa Posted November 24, 2016 Author Posted November 24, 2016 19 hours ago, Paul said: Hi Danny, If you want to start a windows service you should use the "net start serviceName" command however if you want to start GUI applications in the console session you need to use PowerShell, setup the PowerShell impersonation in the Pulseway Manager app in the Settings -> Runtime tab and finally use Start-Job { C:\Windows\System32\notepad.exe } . -Paul Hi Paul, I didn't work that much with powershell. In Pulseway I found the way how to impersonate but if I fill in my credentials from Windows it doesn't work. Do I need to configure this in powershell also or is that not necessary? - Danny Agrippa
Administrators Paul Posted November 25, 2016 Administrators Posted November 25, 2016 23 hours ago, Danny Agrippa said: Hi Paul, I didn't work that much with powershell. In Pulseway I found the way how to impersonate but if I fill in my credentials from Windows it doesn't work. Do I need to configure this in powershell also or is that not necessary? - Danny Agrippa It should work... Can you please PM me your email address so we can get in touch via email to see what the problem is? -Paul
BartB Posted April 11, 2019 Posted April 11, 2019 Try running your script like this: start C:\Windows\System32\notepad.exe That should launch the app on the agent Desktop.
Varinder Posted August 2, 2019 Posted August 2, 2019 On 11/24/2016 at 1:28 AM, Paul said: Hi Danny, If you want to start a windows service you should use the "net start serviceName" command however if you want to start GUI applications in the console session you need to use PowerShell, setup the PowerShell impersonation in the Pulseway Manager app in the Settings -> Runtime tab and finally use Start-Job { C:\Windows\System32\notepad.exe } . -Paul Hi Paul, I have the same issue, just the difference is that I want to start Dropbox. I checked your instructions but under Runtime tab, I can't see any thing for Start-Job. All I can see is an option for Enable PowerShell User Impersonation and fields for Username and password. Could you please assist me that what step I am missing. Thank you. Kind regards, Varinder
Staff Chris Posted August 19, 2019 Staff Posted August 19, 2019 Hi @Varinder, If you want to run the application in users session with GUI, then you will need to use the PsExec to do that. Quote However if you want to start the service in user session, then you might do it using powershell after you have enabled the Powershell Impersonation using required user account.
eDecisions Posted August 6, 2020 Posted August 6, 2020 if you like to run a command as the user a quick way is to create and run a scheduled task setup as the logged in user and run it, see power shell example to start and restart explorer. #By eDecisions $TasknameStop = "ExplorerStop" $TasknameStart = "ExplorerStart" $lastlogon = (New-Object -ComObject WScript.Shell).RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnUser") SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $TasknameStop /RU $lastlogon /TR "taskkill /f /im explorer.exe" SCHTASKS /CREATE /sc ONCE /st 00:00 /TN $TasknameStart /RU $lastlogon /TR "explorer.exe" start-sleep -s 1 schtasks /Run /TN $TasknameStop start-sleep -s 1 schtasks /Run /TN $TasknameStart start-sleep -s 1 schtasks /delete /tn $TasknameStop /f schtasks /delete /tn $TasknameStart /f
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now