| View previous topic :: View next topic |
| Author |
Message |
cokecan72 Newbie
Joined: 14 Oct 2003 Posts: 11
|
Posted: Oct 19th, 2003 06:19 AM Post subject: remote shutdown |
|
|
hi all. im tryin to make a program that shuts down the other computer on my netowrk remotly. ive read that it can be done with winsock and some api (cant remember what) but i havnt a clue about winsock or api's. can anyone help? i've tried downloading programs that are supposed to do it but they dont work. i have got one that shuts down this comp but cant access the other one? maybe something up with my network???? anyway, thought it wud be nice to make my won???
thanks
btw avis, nice make over and how come i never got any emails about it changing? i found out off my friend who got an email off you????? _________________ Damn right im good in bed....
I can sleep for days! |
|
| Back to top |
|
cokecan72 Newbie
Joined: 14 Oct 2003 Posts: 11
|
Posted: Oct 19th, 2003 06:32 AM Post subject: |
|
|
lol won should be own! _________________ Damn right im good in bed....
I can sleep for days! |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 19th, 2003 11:46 AM Post subject: |
|
|
For the shutdown APIs have a look here : www.jaredshelp.com/article65.htm
As for the winsock control you need one thing mainly. The IP of the remote computer. If you can have that it is all easy. I'll try and make you a simple app that shows the basic commands of the winsock control
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 21st, 2003 10:11 AM Post subject: |
|
|
Here it is...  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 21st, 2003 10:12 AM Post subject: |
|
|
And the client... _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
cokecan72 Newbie
Joined: 14 Oct 2003 Posts: 11
|
Posted: Oct 22nd, 2003 02:02 PM Post subject: |
|
|
hey P.T.A.M, thanks for the program you made. it works perfectly. now i have run into a problem though. neither of my comps will shut down after i put the shutdown code in. i did get it to shutdown but then displayed the "it is now safe to turn your computer off" screen. i want it to power off so i tried this API:
this is in a module
Public Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_POWEROFF = 5
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1
and this in the code
Dim lRet As Long
lRet = ExitWindowsEx(EWX_POWEROFF, 0)
but it doesnt work. the only thing that does work is the log off one.
any ideas???
thanks  _________________ Damn right im good in bed....
I can sleep for days! |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 22nd, 2003 03:24 PM Post subject: |
|
|
Did you use the code from the site I gave you above? I'll have to check that out... Tomorrow though...
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
cokecan72 Newbie
Joined: 14 Oct 2003 Posts: 11
|
Posted: Oct 22nd, 2003 05:03 PM Post subject: |
|
|
i did look on the site, didnt really know what most of it did and was gettin very confused by it so had another look for something simpler, thanks anyway.
theres no hurry in this, when ever you can wud be great. you help me out enough on this forum  _________________ Damn right im good in bed....
I can sleep for days! |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 22nd, 2003 05:06 PM Post subject: |
|
|
What version of windows do you have?
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
cokecan72 Newbie
Joined: 14 Oct 2003 Posts: 11
|
Posted: Oct 23rd, 2003 03:41 AM Post subject: |
|
|
Win XP pro. using VB 6 _________________ Damn right im good in bed....
I can sleep for days! |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 23rd, 2003 05:26 PM Post subject: |
|
|
In the page I posted above, copy the code from there and add it to a module. Then from a code try calling either the ShutDownNT sub or the PowerOffNT sub. That should work
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
cokecan72 Newbie
Joined: 14 Oct 2003 Posts: 11
|
Posted: Oct 24th, 2003 10:26 AM Post subject: |
|
|
thanks guys, it works perfectly. i sort of know whats goin on with that code you gave me P.T.A.M. i can log-off, restart, shutdown and power off the other computer on my network.
Avis, the code on the site P.T.A.M gave me shud work perfectly for you to, try it?
thanks again  _________________ Damn right im good in bed....
I can sleep for days! |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 24th, 2003 10:50 AM Post subject: |
|
|
Give it a shot Avis. I remember it working
Philip _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|