Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » General

Post new topic   Reply to topic
remote shutdown
View previous topic :: View next topic  
Author Message
cokecan72
Newbie


Joined: 14 Oct 2003
Posts: 11

PostPosted: Oct 19th, 2003 06:19 AM    Post subject: remote shutdown Reply with quote

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 Smile
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
View user's profile Send private message Send e-mail Visit poster's website
cokecan72
Newbie


Joined: 14 Oct 2003
Posts: 11

PostPosted: Oct 19th, 2003 06:32 AM    Post subject: Reply with quote

lol won should be own!
_________________
Damn right im good in bed....

I can sleep for days!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 19th, 2003 11:46 AM    Post subject: Reply with quote

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 Wink

Philip
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 21st, 2003 10:11 AM    Post subject: Reply with quote

Here it is... Smile
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 21st, 2003 10:12 AM    Post subject: Reply with quote

And the client...
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
cokecan72
Newbie


Joined: 14 Oct 2003
Posts: 11

PostPosted: Oct 22nd, 2003 02:02 PM    Post subject: Reply with quote

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 Smile
_________________
Damn right im good in bed....

I can sleep for days!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 22nd, 2003 03:24 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
cokecan72
Newbie


Joined: 14 Oct 2003
Posts: 11

PostPosted: Oct 22nd, 2003 05:03 PM    Post subject: Reply with quote

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 Smile
_________________
Damn right im good in bed....

I can sleep for days!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 22nd, 2003 05:06 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
cokecan72
Newbie


Joined: 14 Oct 2003
Posts: 11

PostPosted: Oct 23rd, 2003 03:41 AM    Post subject: Reply with quote

Win XP pro. using VB 6
_________________
Damn right im good in bed....

I can sleep for days!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 23rd, 2003 05:26 PM    Post subject: Reply with quote

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 Wink

Philip
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Oct 24th, 2003 01:40 AM    Post subject: Reply with quote

Hi!

I made a program which was like AutoShutDown..it shutdowns the pc at the desired time...but i encountered similar problem like cokecan72 had and i found no solution to fix it. Sad

I hope this works!

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
cokecan72
Newbie


Joined: 14 Oct 2003
Posts: 11

PostPosted: Oct 24th, 2003 10:26 AM    Post subject: Reply with quote

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 Smile
_________________
Damn right im good in bed....

I can sleep for days!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Oct 24th, 2003 10:50 AM    Post subject: Reply with quote

Give it a shot Avis. I remember it working Wink

Philip
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic