1

Check everywhere for a reason but nothing I found matches my specific problem. I have a program in C:\somefoldername\anothersubdirectory\andanother\ of the remote pc that I try to run using PSEXEC but it does not take. PSEXEC just does not want to run anything for me. Now if I run a ping or tasklist via psexec, it works, though obviously this is in PATH.

So I am putting in:

PSEXEC \\pcname C:\somefoldername\anothersubdirectory\andanother\program.exe

and nothing happens.

I even wrote a batch script that I tried running in two different ways.

Script is just:

@ECHO OFF
C:\somefoldername\anothersubdirectory\andanother\program.exe
EXIT

and I had it copied to the remote pc's main directory (maybe I need to put it in a folder) and then I tried running C:\batch.bat using:

PSEXEC \\pcname C:\batch.bat

I also tries running:

PSEXEC \\pcname -c \\servername\batch.bat

so it copies it over to PATH.

Neither worked.

Does any program I try to run via PSEXEC have to be in the remote pc's path?

I do have to admit that I have not done running an EXE remotely, but I have written lengthier scripts using psexec that use batch file on a server without any hiccups.

What is weird to is that the program I run has parameters and I task that runs through it, so I first taskkill it remotely, then I PSEXEC the SAME EXACT EXE as:

psexec \\pcname C:\...\program.exe -a -few -parameters ODBC

and that works. When I try to open just program.exe on its own, nope doesn't take.

I also did try psexecing iexplore.exe and that didn't work either.

yonisha
  • 2,956
  • 2
  • 25
  • 32
user3377627
  • 363
  • 3
  • 7
  • 22

2 Answers2

1

Can you please try this format

psexec \\machineName -u username -p password /accepteula -h cmd /c  
C://somefoldername//anothersubdirectory//andanother//program.exe >>log.txt

More Clearly

  1. Download the PSEXEC tool zip file in your user machine and unzip it.
  2. Open command prompt and go to the psexec path. In my machine it is: D:\PsTools

  3. Run following command line Syntax:

    D:\PsTools> psexec \\ip_address -u username -p Password cmd  /c  executablename  arguments  >> test.log
    
shA.t
  • 16,580
  • 5
  • 54
  • 111
DRD
  • 51
  • 1
  • 3
  • 11
  • So I did this...and here are the results. It opens the .exe (i tested my program and IE) but invisibly. It has a PID and shows up in tasklist, but is not visible. When I run psexec with the -i option, it shows the program(s) in question, but they appear wrong; ie missing huge chunks of the gui. The invisible portion explains why when I ran IE, the psexex screen would freeze in the Mark Russinovich Sysinternals message, if the -d option is not turned on. I would think nothing was running, but something, was in the background. The -i would make it appear, but again weird. Any fixes for this? – user3377627 Jul 12 '14 at 08:11
  • Is Psexec meant to be used to run (i guess in this case just "open") an application, and leave it open? That is what I am trying to do with my app and IE, both highly GUI dependent applications. I'm guessing some part of the GUI is not loading. – user3377627 Jul 12 '14 at 08:13
  • Oh and again, if I run it calling for cmd and have cmd run the application, it does the same exact thing with the GUI. – user3377627 Jul 12 '14 at 08:55
1

So gotta use the -i option. In addition to that, gotta use -p + -u or -s to load system hardware dependent gui. This is why large portions of the gui was missing, or I assume why.

user3377627
  • 363
  • 3
  • 7
  • 22