Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

remote shutdown

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

715 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