Recent

Author Topic: Run windows exe on remote pc  (Read 18804 times)

epergola

  • Full Member
  • ***
  • Posts: 157
Run windows exe on remote pc
« on: April 03, 2016, 10:33:31 pm »
Hi

Does anyone know how to run an EXE or a DLL on a remote pc from a mobile device?
This is the scenario:
Have a database  EXE (or a DLL) on A Windows PC.
From the mobile, using its browser, I want to send a request (by opening an html file on the PC) to the remote PC so that it runs LOCALLY (=WITHIN ITS OWN RAM) the EXE which simply creates a report and sends it in html format back to the mobile browser.
Is it possible?
Thanks

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Run windows exe on remote pc
« Reply #1 on: April 04, 2016, 01:05:41 am »
Sounds like you're describing a Web app, where the PC is the server (eg, with an FCGI .exe) and the mobile device is the client (HTML/Javascript downloaded from the PC).

-Phil

epergola

  • Full Member
  • ***
  • Posts: 157
Re: Run windows exe on remote pc
« Reply #2 on: April 04, 2016, 07:22:28 am »
thanks Phil for your reply.
I do not excactly what a "web app" is .
I hae an EXE that is a dektop application on the PC.
when called it makes a report (e.g a list of all customer) and saves to an html file tha it also sends to the requester (mobile).
My major problem is how to start an EXE on the PC that runs inside its RAM aND DOES THE JOB. Anything I tried either does nothing or DOWNLOADSW  the EXE.
I want it to be run in the PC RAM.
Is that possible?


Thaddy

  • Hero Member
  • *****
  • Posts: 18982
  • Glad to be alive.
Re: Run windows exe on remote pc
« Reply #3 on: April 04, 2016, 07:35:53 am »
Phill's answer is correct. What you want is a webserver functionality in the database app or together with the database app on the pc. It then serves the html output to your mobile. On your mobile it can be displayed through the normal mobile browser or through an embedded browser as a web app. You can use a cgi or fastcgi module to do that or even have all server functionality in your database application. All the processing will be done on the PC side and in the PC's memory, except for the request/response script code inside the html. That is handled by the mobile.
« Last Edit: April 04, 2016, 07:37:59 am by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Run windows exe on remote pc
« Reply #4 on: April 04, 2016, 08:43:04 am »
Exactly, web application is the way to go here. At the worst, if you don't want to implement it, you still have to do raw socket programming, which is much harder, and create protocol to execute the remote app and returning the report you want. That, is not just more complicated, but also a lot harder to secure.

epergola

  • Full Member
  • ***
  • Posts: 157
Re: Run windows exe on remote pc
« Reply #5 on: April 04, 2016, 10:39:24 am »
Uhm,
I guess I cannot explain myself well.
My problem is NOT how to RESPOND or RETURN the report to the mobile (at least not know).
My problem is this;
How can I LAUNCH/START/ EXECUTe the EXE
residing on the remote PC from the mobile device using the mobile browser.
I want that EXE to be run in the PC's RAM.
Forget about the response for a moment.
Suppose the EXE on the remote PC simply creates a file  abc.TXT on the PC disk AND THAT IS ALL. No return or response to the mobile.
How do I launch/start/execute/run that EXE on the PC from the mobile browser?? THAT is the question.
For example. suppose i have an EXE on the PC that simply adds to a text file
"Date/Time now is ........"..
Well, if I run that EXE on the PC it will do exactly that.
I want to run that EXE from a mobile browser and want it to do the same thing on the PC, nothing more
Is that possible?
Everything I tried  DOWNLOADS THE exe. I do NOT want that, I want it to run the EXE residing on the PC inside the PC RAM AS IF the EXE was run from the PC itself.
Is it possible?

balazsszekely

  • Guest
Re: Run windows exe on remote pc
« Reply #6 on: April 04, 2016, 11:08:02 am »
@epergola
To accept a request from a browser(even if you do not wish to respond) you need a web server/web application. Somebody/something must be listen on the other side of the line, otherwise there is no communication.

Bart

  • Hero Member
  • *****
  • Posts: 5713
    • Bart en Mariska's Webstek
Re: Run windows exe on remote pc
« Reply #7 on: April 04, 2016, 11:08:27 am »
You clarified yourself very well the first time.
The answer is still the same as before.

Bart

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Run windows exe on remote pc
« Reply #8 on: April 04, 2016, 11:16:23 am »
You clarified yourself very well the first time.
The answer is still the same as before.

Bart
+infinity

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: Run windows exe on remote pc
« Reply #9 on: April 04, 2016, 11:16:44 am »
It is very possible, of course. I guess you cannot comprehend the given answers very well. Let me try…

Because you want to use mobile browser on a mobile device, then you need to access the .exe through a web server running on the same PC where the .exe resides. To access the .exe through a web server, you need a web app that is triggered by web request (in the form of a URL requested from the mobile browser) to execute the .exe file. Once the .exe file got executed locally on the PC, it will produces a report file (let assume it as a .txt file) that is also created locally.

FYI, most web apps basically work like that.

Later, if you want to see the .txt file from the mobile device as well, you need the web app to read the .txt file and send its content to the mobile browser. You may make the file downloaded as is, or display the content as HTML output to be rendered on the mobile browser. Your choice.

Do you understand?
-Bee-

A long time pascal lover.

serbod

  • Full Member
  • ***
  • Posts: 146
Re: Run windows exe on remote pc
« Reply #10 on: April 04, 2016, 12:05:02 pm »
How can I LAUNCH/START/ EXECUTe the EXE

Web apps is almost a same as Telnet.

In Telnet you give command and parameters, it executes on remote machine and return output.
Code: Pascal  [Select][+][-]
  1. > dir.exe
  2. 05.02.2016  17:40               940 README.txt

In HTTP you give command and parameters (in URL), it executes on remote machine and return output.
Code: Pascal  [Select][+][-]
  1. > GET /cgi-bin/dir.exe
  2. <HTML>
  3. <HEAD>dir.exe output</HEAD>
  4. <BODY>
  5. 05.02.2016  17:40               940 README.txt
  6. </BODY>
  7. </HTML>

So, web server just show or execute files, that you specified in URL string.

Thaddy

  • Hero Member
  • *****
  • Posts: 18982
  • Glad to be alive.
Re: Run windows exe on remote pc
« Reply #11 on: April 04, 2016, 01:48:48 pm »
My problem is this;
How can I LAUNCH/START/ EXECUTe the EXE
residing on the remote PC from the mobile device using the mobile browser.
I want that EXE to be run in the PC's RAM.
Is it possible?
Well, yes, but you still need to have a webserver running on the PC in some form. (even windows remote desktop and similar)
The mobile can then request the webserver to start a script or batchfile that starts the executable.

Basically everybody here is already putting you on the right track....
« Last Edit: April 04, 2016, 01:52:47 pm by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Run windows exe on remote pc
« Reply #12 on: April 04, 2016, 04:34:28 pm »
Is your exe some unique piece of software ?
Can we know what it is as it might have some sort of capability that could help in this instance ?

Does something like this run your exe, even on the same pc ?
Add shellApi to the uses clause of a simple form and button.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   if ShellExecute(0,nil, PChar('your.exe'),nil,nil,1) =0 then;
  4. end;
  5.  
« Last Edit: April 04, 2016, 04:41:54 pm by Zath »

Bart

  • Hero Member
  • *****
  • Posts: 5713
    • Bart en Mariska's Webstek
Re: Run windows exe on remote pc
« Reply #13 on: April 04, 2016, 05:14:15 pm »
Add shellApi to the uses clause of a simple form and button.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   if ShellExecute(0,nil, PChar('your.exe'),nil,nil,1) =0 then;
  4. end;
  5.  

If that code, when executed from your program on your computer would actually run "your.exe" on my computer, then no zero-day exploits were needed anymore to get control of anyones computer.

Bart

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Run windows exe on remote pc
« Reply #14 on: April 04, 2016, 05:52:21 pm »
Add shellApi to the uses clause of a simple form and button.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   if ShellExecute(0,nil, PChar('your.exe'),nil,nil,1) =0 then;
  4. end;
  5.  

If that code, when executed from your program on your computer would actually run "your.exe" on my computer, then no zero-day exploits were needed anymore to get control of anyones computer.

Bart

I realise its not the best piece of code in the world but if his "exe" doesn't even run with that locally, then remotely will likely be a nightmare, even with something better written.
I wasn't suggesting he use it as a basis for a programme  ;)

 

TinyPortal © 2005-2018