Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing an Exe or a Bat file from a remote machine 1

Status
Not open for further replies.

sxs90

Programmer
Oct 3, 1999
10
US
Need to launch a BAT file that resides on a server(remote)<br>
How can one write a DOS shell fucntion via VB (from a client ) to Run the BAT file. <br>
Does not necessarily have be a DOS command. A hidden TELNET session to the remote server and then plainly typing the name of the BAT file would also do the job. Thanks<br>
<br>
Sandy
 
Have you looked at the Shell function? Following example is from vb help:<br>
<br>
RetVal = Shell(&quot;C:\WINDOWS\CALC.EXE&quot;, 1) ' Run Calculator.<br>
<br>
If you are mapped to the remote server you could specify the whole path name & bat file. You may need to load the command processor first for example:<br>
<br>
Shell(&quot;cmd /c X:\Utilities\test.bat&quot;, 1)<br>
<br>
look up cmd in NT help.<br>
<br>
I have also seen rcmd for remote processing but have not used it. Syntax is:<br>
<br>
rcmd \\servername path\program<br>
<br>
From what I can tell rcmd is available on NT server but not NT workstation.<br>

 
rexec is on my workstation<br>
<br>
C:\users\default&gt;rexec<br>
<br>
Runs commands on remote hosts running the REXEC service. Rexec<br>
authenticates the user name on the remote host before executing the<br>
specified command.<br>
<br>
REXEC host [-l username] [-n] command<br>
<br>
host Specifies the remote host on which to run command.<br>
-l username Specifies the user name on the remote host.<br>
-n Redirects the input of REXEC to NULL.<br>
command Specifies the command to run.<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= > </a><br>
 
Thanks to both responses. I will try them out.
 
Thanks to both responses. I will try them out.
 
Thanks to both responses. I will try them out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top