Isaac
Lifelong Learner
- Local time
- Yesterday, 22:49
- Joined
- Mar 14, 2017
- Messages
- 11,044
@Gaztech
I'm trying to run some psexec commands (beginner at it). I noticed in this thread you are using psexec. I wondered if you had any experience yet with using it on the local machine, to run an executable and use that executable to open a file. (for example, to fire up excel.exe and open an .xlsx). AND I want to impersonate other credentials (like runas).
I had some luck incrementally, but my commands stopped working as soon as I added the file path after the executable path. I'm sure I just don't quite understand the syntax, have been studying a few tutorial websites but came up short.
This works (fires up Notepad.exe, just a blank one)
So by this time I know my syntax for:
This does nothing (except pop back with the standard, 3-line boilerplate copyright stuff....but with NO mention of ANY return/result/error code (whereas the successful one above, does come back with "C:\Windows\system32\notepad.exe exited with error code 0."
I'm trying to run some psexec commands (beginner at it). I noticed in this thread you are using psexec. I wondered if you had any experience yet with using it on the local machine, to run an executable and use that executable to open a file. (for example, to fire up excel.exe and open an .xlsx). AND I want to impersonate other credentials (like runas).
I had some luck incrementally, but my commands stopped working as soon as I added the file path after the executable path. I'm sure I just don't quite understand the syntax, have been studying a few tutorial websites but came up short.
This works (fires up Notepad.exe, just a blank one)
Code:
"C:\Users\UserName\OneDrive - OrgName\Desktop\RunAs Test\psexec.exe" -i -u domain\UserName -p Password C:\Windows\system32\notepad.exe
So by this time I know my syntax for:
- referring to psexec path
- interactive switch
- username & password for the account
- referring to notepad exe path
This does nothing (except pop back with the standard, 3-line boilerplate copyright stuff....but with NO mention of ANY return/result/error code (whereas the successful one above, does come back with "C:\Windows\system32\notepad.exe exited with error code 0."
Code:
"C:\Users\UserName\OneDrive - OrgName\Desktop\RunAs Test\psexec.exe" -i -u domain\UserName -p Password "C:\Windows\system32\notepad.exe \\server\data\mpsc-users\UserName\Test\sadf.txt"