Questions tagged [psexec]

PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, complete with full interactivity for console applications, without having to manually install client software.

PsExec is a Windows command line tool written by Mark Russinovich and available through Microsoft's Windows Sysinternals: http://technet.microsoft.com/en-us/sysinternals/default.

From Sysinternals:

Utilities like Telnet and remote control programs like Symantec's PC Anywhere let you execute programs on remote systems, but they can be a pain to set up and require that you install client software on the remote systems that you wish to access. PsExec is a light-weight telnet-replacement that lets you execute processes on other systems, complete with full interactivity for console applications, without having to manually install client software. PsExec's most powerful uses include launching interactive command-prompts on remote systems and remote-enabling tools like IpConfig that otherwise do not have the ability to show information about remote systems.

The 'PS' prefix has nothing to do with PowerShell - it appears because a previous tool by the same author used a 'PS' prefix (PsList, for listing information about processes). Various related tools are packages together in a suite called 'PsTools'.

839 questions
5
votes
2 answers

Batch File - Catching PSEXEC result

If I run a successful PSEXEC command, it says this... "cmd exited on workstation.domain with error code 0." Is there any way I can prevent this and do something like psexec \\workstation.domain -u username -p password cmd /c "assoc.pdf= " if…
Clarkey
  • 698
  • 3
  • 11
  • 28
5
votes
1 answer

psexec not recognized

I am working on a Microsoft Server 2008 machine. For some reason, the command "psexec" is not working from powershell on this 1 machine. When I try to run it I get this: PS C:\> psexec The term 'psexec' is not recognized as the name of a cmdlet,…
user952342
  • 2,602
  • 7
  • 34
  • 54
4
votes
1 answer

How do you run jvisualvm.exe under the local system account under Windows Server 2008?

I've been looking for a comparable approach as posted here for Windows Server 2003 for starting jvisualvm under system account. But I got the error: ...\jdk1.6.0_24\bin\jvisualvm.exe exited on ... with error code -1073741819. I found that…
4
votes
2 answers

Issues with running a PsExec process from code

I am experiencing a weird issue when attempting to run a .NET command line tool remotely using PsExec. When running PsExec from command line, it runs and completes fine. When running it from a console application (creating a process, running…
lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
4
votes
3 answers

psexec inside visual studio

I've been trying to get psexec to run executables on remote machines from custom build tasks in visual studio. All of these commands work from the command line but running it from an application seems to be a problem. Some commands work, on other…
benzhi
  • 116
  • 1
  • 5
4
votes
1 answer

PsExec works only with "runas /netonly", not with -u and -p parameters

What I mean: If I... run runas /netonly /user:computername\username cmd enter the password for the local admin account "username" then type psexec \\computername cmd I now have a working shell and can run commands as the local admin user on…
Mini
  • 445
  • 5
  • 17
4
votes
4 answers

How to restart IIS on remote windows server from windows 7 client machine?

I am trying to restart iis remotely (Windows Servr 2012) from my local machine (Windows 7). The below command in command line doesn't work to restart IIS; iisreset servername /restart but the below command works fine when I tried in command…
user28
  • 249
  • 2
  • 7
  • 20
4
votes
4 answers

Could not connect sessionID 0 to sessionname console .bat from psexec

I'm attempting to force a VM to log the current user out and send the session to the console via running a .bat script. I can get this working if I manually run a .bat file on the VM which contains the following: %windir%\System32\tscon.exe 0…
adjuzy
  • 511
  • 2
  • 6
  • 22
4
votes
1 answer

PsExec from ant does not terminate

I want to start and stop a tomcat server on a remote windows machine. I want to be able to do this from an ant script (so our build server can do this). I wasn't able to get this solved using sc.exe, because there is no way to pass username and…
lagurz
  • 93
  • 1
  • 2
  • 10
4
votes
1 answer

How to determine where the exit code is coming from?

Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.CreateNoWindow = true; p.StartInfo.FileName =…
Pablo
  • 28,133
  • 34
  • 125
  • 215
4
votes
4 answers

How to get Currently logged user's session ID?

I'm running a process from inside a windows service using ProcessStartInfo processStartInfo = new .... Process.Start(processStartInfo); The problem is, if I run service under local system account, it runs alright, but it doesn't show the programs'…
iLemming
  • 34,477
  • 60
  • 195
  • 309
4
votes
0 answers

Running AutoIt script using psexec

I am trying to automate installation of an exe file on remote systems. My AutoIt script automates the installation. If I run this script from the system where I need to install, everything works fine. Problem occurs when I initiate the script from a…
user145078
  • 241
  • 2
  • 3
  • 8
4
votes
4 answers

Running exe with parameters doesn't work

var p = Process.Start(@"c:\PsTools\PsExec.exe", @"C:\Windows\System32\notepad.exe"); var err = p.StandardError.ReadToEnd(); var msg = p.StandardOutput.ReadToEnd(); lblStatusResponse.Text = "Err: " + err + "Msg: " + msg; Why is my code not…
MrProgram
  • 5,044
  • 13
  • 58
  • 98
4
votes
2 answers

Session ID in PSExec

Psexec fails to display a notepad GUI on the remote session for me. So, I am trying to get the session id as below: c:\Users\Amitra\Downloads\PSTools>PsExec -u administrator -p force \\135.20.230.160 query session PsExec v2.11 - Execute processes…
user3565150
  • 884
  • 5
  • 21
  • 49
4
votes
0 answers

PsExec: Couldn't access [MachineName]: Access is Denied

I'm trying to use PsExec to start a process on a remote machine. I've looked at a few other questions here and tried what they've suggested to no avail, which leads me to believe I may be overlooking something that wasn't mentioned in those…
Sean Cogan
  • 2,516
  • 2
  • 27
  • 42