user3377627
user3377627

Reputation: 387

Psexec is not running an EXE program remotely

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.

Upvotes: 1

Views: 23764

Answers (2)

DRD
DRD

Reputation: 51

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
    

Upvotes: 1

user3377627
user3377627

Reputation: 387

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.

Upvotes: 1

Related Questions