Solved

Executing remotely from program

Posted on 2002-03-12
7
132 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

803 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