• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Run executable file on remote Windows machine

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is it possible to run an executable file (e.g. bat or exe or runnable jar) on another Windows machine than the one where I am running my Java program (in the same network)?
The executable file is already on that remote machine, and I have the credentials to log in as an admin on that machine (i.o.w. I can log in as an admin on that machine using Remote Desktop).
I am trying to automate running a script on several Windows machines in my network. So I don't want to run the file manually or set up a scheduled task, but I want to start it from my client pc where I am running my Java program.

Cheers,
Kjeld


 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try psexec utility. Here's info on how it works internally.
We used to use this for same requirement as you have stated. Doesn't need any custom server component or something installed on the target machine.
 
Kjeld Sigtermans
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for this; but what I am looking for is a Java API, so I can do exactly that from my Java program. Sorry if I was unclear about that.
Installing something like PsExec and then run it from my code is also not an option for me. I am really looking for a API equivalent to something like PsExec.

Cheers,
K
 
Kjeld Sigtermans
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Better late than never: I finally went with the psexec solution, since I was unable to find a framework with which I could accomplish the same thing.

Thanks!
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic