[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Restarting  a remote machine

Posted on 1998-09-21
Medium Priority
Last Modified: 2013-11-13
How can I restart a remote machine, which is running windows-95.It is in the same workgroup.I do not want to use pc-anywhere.can you tell me a program which I can write to restart the remote machine.

     The problem is we need to access the remote machine through pc-anywhere but some times ,the employees of that company shut off pc-anywhere.At this point of time the machine is on but i cannot access the machine through pc-anywhere.So,If i reboot the system,pc-anywhere loads up as it is in the start up group.
Question by:zeus_akkali
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Accepted Solution

sunj earned 150 total points
ID: 1436003
 One simple way I can think of is to write a server program as well as a client program. The server will be running on the remote machine, listening at some predefined port. If a connection comes and regarded as a valid request, the server program can send appropriate windows message to restart the windows(Actually, in your case it might be more straightforward to ask your server to invoke the pc-anywhere program). You can put the server program to the startup group and since no window is needed for the server, it is invisible and the employees there will not be able to terminate the server simply(unless they get the process list and kill the server process).  
Let me know if you have problems writing client/server winsock programs and I may put some source code here.


Author Comment

ID: 1436004
I like the Idea given by you and would appreciate if you ge me a head on start with with winsock programming.Iam new to winsock.

Thank You,
LVL 14

Expert Comment

ID: 1436005
If you want, I have code to shutdown directly NT workstation across the network without any client, winsock..., but it doesn't work under Win 95

Expert Comment

ID: 1436006
Hi, zeus_akkali:

  Winsock programming wasn't an easy task. However, with Visual Basic and Microsoft Winsock Control, a lot of details are hidden and programming is much easier. First of all, add a Winsock Control to your form. To create a server, you have to specify the LocalPort property. That is the port that your server will be listening at(and this is port that your client should connect to). Then, in your form's Load method, you can start the server by calling Winsock1.Listen method. Now if your client tries to connect to the server, there will be a ConnectionRequest event which means your Winsock1_ConnectionRequest will be called. Usually here we will perform some check and accept the connection and send some data back to the client. However, in your case it is much easier as we do not have to feed back anything to the client. What you can do in Winsock1_ConnectionRequest() is simply invoking the PCanywhere program(by Shell() or whatever).  
  To make connection to the server, you can write your own client using winsock control. But again, you can make life easier by using the telnet's functionality. You can do this to send a connection request to server:

  telnet 123.456.789.0 7777

Here we assume your server's ip is 123.456.789.0 and the server is listening at port 7777.

  Below is some sample code about the server. You can see it is very short. :) Assume you have a Winsock control "Winsock1" on your form and here the server simply invokes windows' calculator program when there is a incoming connection request.(try telnet!)  

Private Sub Form_Load()
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
End Sub

Private Sub Form_Unload(Cancel As Integer)
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)    ' Run Calculator.
End Sub

Let me know.


Author Comment

ID: 1436007
Thank You Sunj for your help.I think this answers my questions.Thank again.


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

650 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