Solved

Executing remotely from program

Posted on 2002-03-12
7
130 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
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

A few months ago I had an issue with LaserJet 1020 printer which was installed to XP and Windows 7.  It was installed to XP and working, but when I tried to connect from a Windows 7 PC, it would attempt connection and then fail.  Sometimes the Spool…
Several part series to implement Internet Explorer 11 Enterprise Mode
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now