Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Which is the best and sure way to shutdown systems

Which is the best and sure way to shutdown systems

Scheduled Pinned Locked Moved Visual Basic
helpcsharpjsonquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amer Rehman 0
    wrote on last edited by
    #1

    Hi I need to shutdown remote systems running on windows xp with Dotnet Framework 1.1 installed. The user is limited on these machines. I have used the following methods to shutdown the systems. 1. wmi Dim oOS, oOperatingSystem As Object                         oOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")                         For Each oOperatingSystem In oOS                               oOperatingSystem.Win32Shutdown(nForcePowerDown)                         Next 2. shutdown.exe of xp The problem is using the wmi sometime fails for reasons I don't know. The other method needs Admin privileges. Which is also an overhead. What should I do? Use the API or there is some other way? Please help as search over internet has not helped me much. Thanks

    reman

    J D 2 Replies Last reply
    0
    • A Amer Rehman 0

      Hi I need to shutdown remote systems running on windows xp with Dotnet Framework 1.1 installed. The user is limited on these machines. I have used the following methods to shutdown the systems. 1. wmi Dim oOS, oOperatingSystem As Object                         oOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")                         For Each oOperatingSystem In oOS                               oOperatingSystem.Win32Shutdown(nForcePowerDown)                         Next 2. shutdown.exe of xp The problem is using the wmi sometime fails for reasons I don't know. The other method needs Admin privileges. Which is also an overhead. What should I do? Use the API or there is some other way? Please help as search over internet has not helped me much. Thanks

      reman

      J Offline
      J Offline
      Johan Hakkesteegt
      wrote on last edited by
      #2

      Let's just assume that your reasons for wanting to do this are entirely legitimate. Think about it, if it were possible to just shut down a remote system, without admin privileges, what would keep hackers from doing so?

      My advice is free, and you may get what you paid for.

      1 Reply Last reply
      0
      • A Amer Rehman 0

        Hi I need to shutdown remote systems running on windows xp with Dotnet Framework 1.1 installed. The user is limited on these machines. I have used the following methods to shutdown the systems. 1. wmi Dim oOS, oOperatingSystem As Object                         oOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")                         For Each oOperatingSystem In oOS                               oOperatingSystem.Win32Shutdown(nForcePowerDown)                         Next 2. shutdown.exe of xp The problem is using the wmi sometime fails for reasons I don't know. The other method needs Admin privileges. Which is also an overhead. What should I do? Use the API or there is some other way? Please help as search over internet has not helped me much. Thanks

        reman

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        If you want to do remote shutdown, you need Admin privileges on the remote machine to do it. There is no way around it, for obvious reasons.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups