Jump to content

launch EXE files with pulseway


theking123
 Share

Recommended Posts

  • Staff

Hi @theking123,

Thank you for contacting us. You can run any file on the remote system using Pulseway. But note one thing: these applications will be started in session zero, therefore you will not be able to see the graphical interface for it. However if you want to run the applications into the users session using Pulseway, then you will need to install PsExec on your system and then add it to the Path, so you can run it from any folder using CommandLine. And then once this is done, then you will be able to launch applications in users session using this command:

psexec /accepteula -i 1 -d "C:\Program Files\Sublime Text 3\sublime_text.exe"

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...
On 10/4/2018 at 11:38 AM, Chris said:

Hi @theking123,

Thank you for contacting us. You can run any file on the remote system using Pulseway. But note one thing: these applications will be started in session zero, therefore you will not be able to see the graphical interface for it. However if you want to run the applications into the users session using Pulseway, then you will need to install PsExec on your system and then add it to the Path, so you can run it from any folder using CommandLine. And then once this is done, then you will be able to launch applications in users session using this command:

psexec /accepteula -i 1 -d "C:\Program Files\Sublime Text 3\sublime_text.exe"

 

I can't get it to work, the log says that psexec : The term 'psexec' is not recognised as the name of a cmdlet,function, script file, or operable program. help, it works fine in cmd and powershell on my account.

Link to comment
Share on other sites

On 10/4/2018 at 11:38 AM, Chris said:

Hi @theking123,

Thank you for contacting us. You can run any file on the remote system using Pulseway. But note one thing: these applications will be started in session zero, therefore you will not be able to see the graphical interface for it. However if you want to run the applications into the users session using Pulseway, then you will need to install PsExec on your system and then add it to the Path, so you can run it from any folder using CommandLine. And then once this is done, then you will be able to launch applications in users session using this command:

psexec /accepteula -i 1 -d "C:\Program Files\Sublime Text 3\sublime_text.exe"

 

Doesn't work, the log says that it can't find psexec, but it works fine on cmd and powershell...

Link to comment
Share on other sites

  • 1 year later...

hello, i just want to share my solution for this problem: often the parameter -i 1 will not work when your current user has a different interface ID, so when launching some programs, like PLEX Web Server for example the program will be launched with wrong settings/default settings instead of your current users settings. For some programs there are no difference but i found this problem for plex and others.

You can get the current ID with this command on powershell: query session and use it on the script/remote powershell every time or if you want here my solution

 

my solution, i hope can help someone

on pulseway script editor run as powershell this script :

cd\
cd "C:\myScriptRUN\PSTools"
.\id_plex.cmd

 

the script with this mod:

id_plex.cmd

for /f "tokens=4 delims= " %%G in ('tasklist /FI "IMAGENAME eq ctfmon.exe" /NH') do SET RDP_SESSION=%%G
echo Current RDP Session ID: %RDP_SESSION%
cd\
cd "C:\myScriptRUN\PSTools"
.\psexec.exe -i %RDP_SESSION% -d -u YOURUSERNAME -p YOURPASSWORD "S:\....\plex.exe"

 

This script will get the current ID from a classic process cftfom.exe (for example) that is usually with the current ID of the user and than run psexec with that ID

Username and password are optional but I recommend them.

PS: yes the first time run /accepteula and follow the guide to add psexec for windows %path%

 

Also i will link my script (for windows), instead of running this script for every kind of program/path i will just run my own program with different parameter

so replace this .\psexec.exe -i %RDP_SESSION% -d -u YOURUSERNAME -p YOURPASSWORD "S:....\plex.exe" with : .\psexec.exe -i %RDP_SESSION% -d --u YOURUSERNAME -p YOURPASSWORD "S:\myREPO\pulseway\pulseway.exe" 1

Where : pulseway.exe is this script and 1 = your program, in my example 1 = plex, 2 = Team Viewer , 3 = etc..

If you want it's here: https://github.com/iTZUNAMI/ahk-pulseway-quicklaunchexe

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

  • 3 months later...

create a task, far easier, I use powershell, just add the command after the TR = Task Run 

 

#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

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...