?
Solved

Restarting  a remote machine

Posted on 1998-09-21
5
Medium Priority
?
286 Views
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.
0
Comment
Question by:zeus_akkali
[X]
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
5 Comments
 
LVL 1

Accepted Solution

by:
sunj earned 150 total points
ID: 1436003
Hi,
 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.

sunj
0
 
LVL 1

Author Comment

by:zeus_akkali
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,
Zeus
0
 
LVL 14

Expert Comment

by:waty
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
0
 
LVL 1

Expert Comment

by:sunj
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.
Winsock1.Listen
End Sub

Private Sub Form_Unload(Cancel As Integer)
Winsock1.Close
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.

sunj
0
 
LVL 1

Author Comment

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

Zeus
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

762 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