Solved

Executing remotely from program

Posted on 2002-03-12
7
134 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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
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…
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…

756 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