Solved

Executing remotely from program

Posted on 2002-03-12
7
136 Views
Last Modified: 2013-12-28
I have a program named READER.EXE on PC 'A'. I need to run it on PC 'A' calling it (with some parameters) from PC 'B'. How can I do this in Win 98?

I mean from a programming language, not using remote control applications or NetMeeting.

Thanks a lot in advance for any help.

AJ
0
Comment
Question by:ajgonzalezm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 59

Expert Comment

by:LeeTutor
ID: 6858720
I think you're asking this in the wrong topic area.  You should use the link at the left under EE Info, called All Topics, and choose one of the Programming topics.  You can delete this question and ask it in a more appropriate place, or else link a zero point question in the other area to this question.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6859104
Descripe the parameters you need to pas? Or are you talking about switches?

var
  siStrtInfo: PStartupInfo;
  piProcInfo: TProcessInformation;


siStrtInfo.cb := SizeOf(TStartupInfo);
dwFlags :=  STARTF_USEPOSITION or STARTF_USESIZE or STARTF_USESHOWWINDOW;
wShowWindow := SW_RESTORE;

CreateProcess('c:\WINNT\MSHEARTS.EXE /TheSwitch', nil, nil, nil, False,CREATE_DEFAULT_ERROR_MODE + NORMAL_PRIORITY_CLASS, nil, nil, siStrtInfo^, piProcInfo);
CloseHandle(piProcInfo.hProcess);

or
         
ShellExecute(Self.Handle, 'OPEN', 'c:\WINNT\MSHEARTS.EXE /TheSwitch', '', 'c:\WINNT\', SW_RESTORE);


Rplace the c:\ with the drive indicator of the PC A. You may have to us \\ as the first part of PC A's indicator


The Crazy One
0
 
LVL 22

Expert Comment

by:cookre
ID: 6859403
If you were on NT, you could do a NOTIFY A from B to run a program on A, but under 9x you'll need something like PCAnywhere on both machines.

If B has X is mapped to A, then doing an X:pgm will just download pgm to B and run it on B.

CrazyOne's code shows several ways to programmatically run a program, but the execution still takes place on B.

0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 6

Accepted Solution

by:
bartsmit earned 100 total points
ID: 6860120
Run a batch file from autoexec on 'A' along these lines:

net use t: \\b\share
:loop
if not exist t:reader.bat goto loop
call t:reader.bat
del t:reader.bat
goto loop

This will run a continous loop checking if there is a batch file on 'B'. As soon as one is placed on a share there it will execute the batch file and then delete it.

To run the application on 'A' just place a batch file with the appropriate paramaters on the share on 'B'

If the batch file takes too much resources on 'A' then add a timewasting instruction after :loop. Something like for %f in (\windows\*.*) do copy \autoexec.bat nul:
0
 
LVL 10

Expert Comment

by:Longbow
ID: 6868327
These are free tools for your problem.
You may run scripts, dos, batch, windows softwares.
But only for Windows NT/2000.
Have an upgrade of Windows 98 ?

Longbow
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 6869225
What language do you want to use?You could create a client/server app to do this using winsock.
0
 

Author Comment

by:ajgonzalezm
ID: 6876613
bartsmit,

I'll not be using bat files but the technique is an easy one and I can implement it on any languaje.

Thanks a lot!

Cheers,


AJ
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question