Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

remote shutdown

Posted on 2006-11-28
3
Medium Priority
?
316 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 2000 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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses

971 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