Solved

remote shutdown

Posted on 2006-11-28
3
305 Views
Last Modified: 2010-04-23
I have now spent hours looking for sample code to write a small application to remotely shut down computers from one machine.
Unfortunately I have not been successfull as all the sample code so far has not been working when I upgraded it into visual studio 2005.
Could anybody give me a sample code or point me in the right direction to find one.
All the PC's are XP Pro machines and I have don't mind I use api or wmi. Whatever is simpliest method.

I have a vbscript which can do that. Maybe I could just call a vbscript from my vb application. Mind you would need to know how to do that.

thanks

Max
0
Comment
Question by:maxgall
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
Mohamed Zedan earned 500 total points
ID: 18030521
try this code and tell me :)

        Dim RemotePC As String = "192.168.0.2" 'Name or IP of remote machine
        Dim p As New Process
        Dim pi As New ProcessStartInfo("Shutdown.exe", "-s  -m \\" & RemotePC & " " & "-t 00 -f")
        pi.WindowStyle = ProcessWindowStyle.Hidden
        p.Start(pi)


but you have to be authorized on the remote machine :)
0
 

Author Comment

by:maxgall
ID: 18046026
That works fine. thanks vm
0
 
LVL 7

Expert Comment

by:Mohamed Zedan
ID: 18048706
You're welcome :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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