| View previous topic :: View next topic |
| Author |
Message |
glynd02
Joined: 09 Jun 2008 Posts: 10 Location: Telford, UK
|
Posted: Mon Mar 01, 2010 3:57 am Post subject: Running psexec.exe [Solved] |
|
|
I was wondering if anyone could shed some light on running psexec.exe please?
I have tried all sorts to get the program to run correctly all have not worked i.e.
| Code: | varPSExecVariable = "psexec \\computername C:\demo.exe"
#x::Run, C:\RemoteTools\psexec.exe %varPSExecVariable%, C:\RemoteTools\
|
And
| Code: | | #x::Run, %comspec% /k psexec.exe %varPSExecVariable%, C:\RemoteTools\ |
Just cannot seem to get the syntax right! Arghh
Any help would be very gratefully received...
Cheers
Last edited by glynd02 on Mon Mar 01, 2010 1:52 pm; edited 1 time in total |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1651 Location: Denmark
|
Posted: Mon Mar 01, 2010 7:09 am Post subject: |
|
|
| Code: | ; no psexec in the variable
varPSExecVariable = \\computername C:\demo.exe
; or
; varPSExecVariable := "\\computername C:\demo.exe"
#x::Run, C:\RemoteTools\psexec.exe %varPSExecVariable%, C:\RemoteTools\ |
_________________ RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2 |
|
| Back to top |
|
 |
glynd02
Joined: 09 Jun 2008 Posts: 10 Location: Telford, UK
|
Posted: Mon Mar 01, 2010 10:03 am Post subject: Running psexec.exe |
|
|
Thanks Tonne, that worked a treat once I had removed the quotes around the Var and the "psexec" from the Var...
Is there any way to close the CMD window, while leaving the EXE running please?
Cheers |
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Mon Mar 01, 2010 10:16 am Post subject: |
|
|
Yes, try this:
| Code: | ; no psexec in the variable
varPSExecVariable = \\computername C:\demo.exe
; or
; varPSExecVariable := "\\computername C:\demo.exe"
#x::Run, %ComSpec% /c C:\RemoteTools\psexec.exe %varPSExecVariable%, C:\RemoteTools\,HIDE |
|
|
| Back to top |
|
 |
glynd02
Joined: 09 Jun 2008 Posts: 10 Location: Telford, UK
|
Posted: Mon Mar 01, 2010 11:55 am Post subject: Running psexec.exe |
|
|
Thanks very much Aaffe
That does not display the CMD window and the program launches correctly, however it is still visible as running in the Windows Task Manager.
If I kill the process in the TaskManager the EXE continues to run OK...
Should I try and use the WinKill or WinClose commands?
Cheers and sorry to be a pain  |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 01, 2010 12:19 pm Post subject: Re: Running psexec.exe |
|
|
Also, try...
| Code: | toolspath:="C:\RemoteTools"
PSExec_exe:="psexec"
PSExec_params="-d \\computername C:\demo.exe"
PSExec_cmd:=PSExec_exe " " PSExec_params
#x::Run, %toolspath%\%PSExec_cmd%, %toolspath% |
...I like vars!...plus the -d means "detach"... |
|
| Back to top |
|
 |
glynd02
Joined: 09 Jun 2008 Posts: 10 Location: Telford, UK
|
Posted: Mon Mar 01, 2010 1:52 pm Post subject: Running psexec.exe [Solved] |
|
|
Thanks you very much Guest
That did the trick, marvelous! Just had to:
1. Remove the speech marks around the PSExec_params variable - for some reason PSExec does not like those at all!
2. Change the PSExec_exe variable to "psexec.exe"
I like vars as well, because they allow you to quickly change stuff if paths change...
Example:
| Code: | toolspath:="C:\RemoteTools"
PSExec_exe:="psexec.exe"
PSExec_params=-d \\computername C:\demo.exe
PSExec_cmd:=PSExec_exe " " PSExec_params
#z::Run, %toolspath%\%PSExec_cmd%, %toolspath%
|
Many thanks to all that answered - you peeps are a great help for those that are struggling
Cheers |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 01, 2010 3:20 pm Post subject: Re: Running psexec.exe [Solved] |
|
|
| glynd02 wrote: | Just had to:
1. Remove the speech marks... |
...double quotes...
| glynd02 wrote: | | ...around the PSExec_params variable |
...sorry, on that line I had = instead of :=...it should've been := like the rest of em...
| Code: | | PSExec_params:="-d \\computername C:\demo.exe" |
| glynd02 wrote: | | 2. Change the PSExec_exe variable to "psexec.exe" |
...I was not sure .exe would be necessary, guess it is... |
|
| Back to top |
|
 |
|