Solved

remote shutdown

Posted on 2006-11-28
3
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

622 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