psexec

How do I detect which program has returned an error code?

Hi, I'm attempting to run a series of commands programmatically, read the error codes, and detect if these codes indicate success or failure so I can respond accordingly. Currently my commands are using psexec which then launches robocopy. I've noted that while most commands return an error code of 0 if the program is successful, roboco...

What's the best way to run remote command line from one Windows host to another?

I used psexec, but it has problem with antiviruses. The other possibility is using WMI, but it's not installed on every Windows machine. ...

svn post-commit hook fails to run with psexec

Below is the script in my SVN post-hook fails to execute on every commit into SVN and hangs c:\PsTools\Psexec.exe \192.168.1.64 -u SERVER1\Administrator -p PASSWORD c:\mybatchfiles\checkin.bat This is to run a batch file on the remote machine (SERVER1) which is located on SERVER1 at c:\mybatchfiles\ But I am able to run the same abov...

Run JAR file with PSExec and CMD

I need to run a jar file on a remote machine. The jar takes several arguments. psexec \\somemachine -i /accepteula -i -u domain\user -p password cmd /S "c:\mydir\myjar.jar" [my jar args here] Can someone tell me how to do this? The closest I have gotten is getting CMD to launch but with not command. ...

PsExec & Windows Server 2008: Privileges & authentication issues

Hey guys, I'm writing an application that helps me auto-deploy my applications to my Windows Server 2008 machines. As apart of this process, I need remotely start and stop IIS websites on my 2008 servers from my test machine. From the scope of my 2008 machine, I'm using: C:\Windows\System32\inetsrv\appcmd.exe stop site "MyWebsite" T...

Run Explorer in SYSTEM account on Windows Vista or 7 using Sysinternal's psexec tool?

Has anyone been successful at launching an instance of Windows Explorer in the SYSTEM account on Windows Vista or 7? It is possible to do this on XP, but I haven't been able to get it to completely work in Vista or 7. Trying to launch Explorer as SYSTEM into session 1 (my user session) results in Explorer exiting immediately and returni...

PsExec on two XP machines

I have two XP machines and I have the following situation. I am running psexec from Comp1 Comp2 does not have any password. My bat file command psexec -i -d -c \comp2 c:\xyz.exe ...

psexec wont call nested bacth file on remote target

Hi all, I am calling psexec from the command line window on my local machine. I am calling a simple batch file that deletes a file and then calls another batch file that deletes yet another file. this delete does not work. PSEXEC return erro code 1. Any clues.... ?-Jonathan ...

Strategy for Automated UI testing on remote virtual machines

I'm using TeamCity for my CI builds, and I'd like to set up a second build for running automated UI tests on Windows XP and Windows 7 virtual machines. I imagine the build working as follows: Compile, run unit tests, etc. Prepare MSI using WiX Copy MSI to target test machines Remotely execute MSI's Copy test harness code to remote m...

Access denied while using multiple psexec one after the other

In order to automate a process on multiple servers I’m using the psexec command I have notice the first command is running OK but the rest of the psexec command in the chain are getting access denied on the server To verify it is not my command I have changed the order of the commands and verify there is no problem in any of my commands ...

PsExec from ant does not terminate

Hi! 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 password to the remote machine. Instead I'm using psexec to run commands on the remote ...

Could not execute java command in remote batch file using psexec. Any solution?

Hello, i am trying to run a batch file in remote. I have the following psexec command in my local machine :C:\PsTools\PsExec.exe \ -u -p -i -d cmd /c start "C:\config.bat" This bat file has the java command, which would start the process java.exe The psexec command says, "cmd started on process id ". But, in remote machine cmd.exe is...

How to determine the session id on remote machine for usage with psexec -i using script/powershell/... ?

Hello, I am in need of a script or powershell command that will be able to determine the session id of a specific logged in user on remote machine, to be later used as parameter to the psexec -i execution of remote gui process on that session of that user on the remote machine. So far i managed to use psexec \\remoteMachine -u user -p...

After remotely running an msi using psexec and msiexec it doesn't show in Add/Remove programs

At the company where I work, we're setting up continuous integration and as part of this we want the daily build cycle to build installers and run them on a staging server. I've written the installers using WiX 3.6 and they run correctly on the staging server when I try logging on using remote desktop and running them using msiexec. If ...