Results 1 to 8 of 8
  1. #1
    drd1988on is offline Member
    Join Date
    Nov 2013
    Posts
    3
    Rep Power
    0

    Default How to run .exe in a remote machine,from my java code

    Both machine are windows, I wants to run an .exe which lies in another machine through my java program

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,090
    Rep Power
    4

    Default Re: How to run .exe in a remote machine,from my java code

    Run how. Is it a graphical tool which you want to start up remotely FROM another machine? Should the application stay running when you start it remotely? Is it a command line utility which you want to run and get the output from?

    Note that this is a highly operating system specific thing to do and Java does not do operating system specific things. Likely this is going to be a lot more work than calling some method on some class.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,602
    Rep Power
    23

    Default Re: How to run .exe in a remote machine,from my java code

    One way: Write a server program that can execute the exe program. Connect to that server and send it a message telling it to execute the exe file.
    If you don't understand my response, don't ignore it, ask a question.

  4. #4
    drd1988on is offline Member
    Join Date
    Nov 2013
    Posts
    3
    Rep Power
    0

    Default Re: How to run .exe in a remote machine,from my java code

    Quote Originally Posted by gimbal2 View Post
    Run how. Is it a graphical tool which you want to start up remotely FROM another machine? Should the application stay running when you start it remotely? Is it a command line utility which you want to run and get the output from?

    Note that this is a highly operating system specific thing to do and Java does not do operating system specific things. Likely this is going to be a lot more work than calling some method on some class.

    Hi ,
    In our case it is a command line utility.Could you please tell how will we do it?

    Rgds
    DRD

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,090
    Rep Power
    4

    Default Re: How to run .exe in a remote machine,from my java code

    Quote Originally Posted by drd1988on View Post
    Hi ,
    In our case it is a command line utility.Could you please tell how will we do it?

    Rgds
    DRD
    Is Norm's post invisible? His solution is very good if you want to do it "in Java". Me: I'd try to find an existing tool outside of Java to do it. Remote Desktop comes to mind.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    Dicksha is offline Member
    Join Date
    Feb 2014
    Posts
    1
    Rep Power
    0

    Default Re: How to run .exe in a remote machine,from my java code

    Hi,
    Can anyone refer me something to read for calling c exec from java code.

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,090
    Rep Power
    4

    Default Re: How to run .exe in a remote machine,from my java code

    Google can.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    kneitzel is online now Senior Member
    Join Date
    Feb 2014
    Posts
    148
    Rep Power
    0

    Default Re: How to run .exe in a remote machine,from my java code

    The information you gave so far is far from complete.

    In case you
    - do not want to install anything on the target systems
    - you have administrative rights on the target systems
    you could start a tool like psexec locally to execute stuff on the target systems.

    But please be aware that this is not a Java solution but a windows solution.

    With kind regards,

    Konrad

Similar Threads

  1. Replies: 6
    Last Post: 05-28-2012, 01:50 PM
  2. Replies: 10
    Last Post: 02-28-2012, 08:44 PM
  3. Java program to ping remote machine using IP address..?
    By prabhurangan in forum New To Java
    Replies: 19
    Last Post: 11-22-2011, 03:58 PM
  4. Connect to remote Windows machine using JAVA on Linux
    By sumukh_death in forum Networking
    Replies: 6
    Last Post: 09-23-2011, 06:23 PM
  5. connect to remote machine
    By RaSdab in forum New To Java
    Replies: 1
    Last Post: 04-23-2011, 01:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •