Solved

Executing remotely from program

Posted on 2002-03-12
7
133 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Computer account cleanup 90 128
Disk Cleanup and Temporary Files 15 56
Batch File search for Drive Letter 8 44
SCSM reports export 1 16
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
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…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

860 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