Jump to content
Danny Agrippa

How to start services (.EXE)

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Try running your script like this:

start C:\Windows\System32\notepad.exe

That should launch the app on the agent Desktop.

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 sakis_s
      Hi! Can anyone please tell me how to get notified (monitoring my PC from an iOS device) when my computer (running windows 10) turns on? The reason is that i have give access to other users as well to turn it on and i want to get notified when this happens. Thanks in advance for your help!
    • By jbohnenstiehl
      Pulseway Dashboard (Currently 6.3)
      Data - All Notifications.
      Currently we can not: Ctrl + Select, Shift + Select All, Ctrl + A, Sort by columns. 
      This is a daily task for me and so it would be fantastic to be able to use these simple functions. 
    • By unfeomateo
      I want to setup a SNMP notification for my canon printer.  The "printer status" OID will show nothing when the printer is working and show a number if there is an error. I have no idea what each and every error might show up as. 
      Is it possible to set the notification to alert me if that SNMP option changed from null to some number? Right now if I leave "value" blank I cannot click ok to finish. 
    • By kavaa
      I made a install script for 7-Zip to do a Silent install and clean if needed.
      Improvements are welcome!
      When a new version of 7-Zip comes out, just change the 7z1604-x64.msi to the new value.
      # Silent Install 7-Zip # http://www.7-zip.org/download.html # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "http://www.7-zip.org/a/7z1604-x64.msi" $destination = "$workdir\7-Zip.msi" # Check if Invoke-Webrequest exists otherwise execute WebClient if (Get-Command 'Invoke-Webrequest') { Invoke-WebRequest $source -OutFile $destination } else { $WebClient = New-Object System.Net.WebClient $webclient.DownloadFile($source, $destination) } Invoke-WebRequest $source -OutFile $destination # Start the installation msiexec.exe /i "$workdir\7-Zip.msi" /qn # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\7*  
    • By lyoder
      This script will check to see if a VPN connection with the given name exists. If it does exist, it updates the VPN connection. If it does not exist, it creates a VPN connection with the given values.
      Note: I believe Pulseway runs PowerShell scripts under the Local System account by default (unless you have defined PowerShell User Impersonation in the Pulseway Manager, I think). In order to expose the VPN to users, this script runs against the Global Phone Book (-AllUserConnection switch). Therefore, this script does not check for the existence of VPN profiles stored in individual user Phone Books. (If an existing user VPN profile exists, this script will create a new VPN in the Global Phone Book, as it will not be able to see the existing user VPN.)
      This script was developed and tested on Windows 10, but should also work on Windows 8/8.1.
      PowerShell VpnClient documentation: https://docs.microsoft.com/en-us/powershell/module/vpnclient/?view=win10-ps
      ################################ # VARIABLES $Name = "VPN" $ServerAddress = "vpn.domain.com" # IP Address or FQDN $TunnelType = "Automatic" # Values: PPTP | L2TP | SSTP | IKEv2 | Automatic $L2tpPsk = '[Insert PSK Here]' $AuthenticationMethod = "MSCHAPv2" # Values: PAP | CHAP | MSCHAPv2 | EAP $EncryptionLevel = "Optional" # Values: NoEncryption | Optional | Required | Maximum $UseWinlogonCredential = $true $RememberCredential = $true $SplitTunneling = $true $DnsSuffix = 'domain.local' ################################ # If PowerShell supports VPN configuration, apply VPN configuration if (Get-Command 'Get-VpnConnection') { # If VPN exists, update VPN settings if (Get-VpnConnection -Name $Name -AllUserConnection -ErrorAction SilentlyContinue) { Set-VpnConnection -Name $Name -AllUserConnection -ServerAddress $ServerAddress -TunnelType $TunnelType -EncryptionLevel $EncryptionLevel -AuthenticationMethod $AuthenticationMethod -SplitTunneling $SplitTunneling -DnsSuffix $DnsSuffix -L2tpPsk $L2tpPsk -UseWinlogonCredential $UseWinlogonCredential -RememberCredential $RememberCredential -Force } # Else, create VPN connection else { Add-VpnConnection -Name $Name -AllUserConnection $true -ServerAddress $ServerAddress -TunnelType $TunnelType -EncryptionLevel $EncryptionLevel -AuthenticationMethod $AuthenticationMethod -DnsSuffix $DnsSuffix -L2tpPsk $L2tpPsk -Force Set-VpnConnection -Name $Name -AllUserConnection -SplitTunneling $SplitTunneling -UseWinlogonCredential $UseWinlogonCredential -RememberCredential $RememberCredential } return Get-VpnConnection -Name $Name -AllUserConnection exit } # Else, exit with failure code else { return "Client does not support VpnClient cmdlets" exit 1 }  
×
×
  • Create New...