Solved

remote shutdown

Posted on 2006-11-28
3
300 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now