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. C#
  4. Remote Shutdown and Processes

Remote Shutdown and Processes

Scheduled Pinned Locked Moved C#
csharphelpworkspace
3 Posts 2 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.
  • F Offline
    F Offline
    fjlv2005
    wrote on last edited by
    #1

    Good day to all, Currently im developing an administrative tool that allows me to monitor all workstation under my domain. I want to do remote shutdown/restart/log-off using C#. At first I was thinking of executing the ff: shutdown -r -f -m \\pcname -t 0 for restart.. shutdown -s -f -m \\pcname -t 0 for shutdown.. I planned to execute it under C# Process & ProcessStartInfo however i feel i doesnt much have control because whenever i shutdown/restart an offline pc, if it is on command line, then it will just hang-up or just a cursor blinking and will not exit the command (maybe it would take too long..). I hope somebody could help me find a way to execute shutdown/restart/log-off remotely which we have better control and more reliable way. Also also want to get remotely,the processes that runs under the client machine/workstation, i hope this is feasible in C#. Im using .NET 2003 environment, thanks a lot, -- modified at 2:39 Friday 17th March, 2006

    J 1 Reply Last reply
    0
    • F fjlv2005

      Good day to all, Currently im developing an administrative tool that allows me to monitor all workstation under my domain. I want to do remote shutdown/restart/log-off using C#. At first I was thinking of executing the ff: shutdown -r -f -m \\pcname -t 0 for restart.. shutdown -s -f -m \\pcname -t 0 for shutdown.. I planned to execute it under C# Process & ProcessStartInfo however i feel i doesnt much have control because whenever i shutdown/restart an offline pc, if it is on command line, then it will just hang-up or just a cursor blinking and will not exit the command (maybe it would take too long..). I hope somebody could help me find a way to execute shutdown/restart/log-off remotely which we have better control and more reliable way. Also also want to get remotely,the processes that runs under the client machine/workstation, i hope this is feasible in C#. Im using .NET 2003 environment, thanks a lot, -- modified at 2:39 Friday 17th March, 2006

      J Offline
      J Offline
      Jijo BP
      wrote on last edited by
      #2

      Try this : string t = "-r -c \"I am going to reboot your mechine\" -t 20"; Process process = new Process(); process.StartInfo.FileName = "shutdown.exe "; process.StartInfo.Arguments = t; process.Start(); I think this will solve your problem. Cheers Jijo

      F 1 Reply Last reply
      0
      • J Jijo BP

        Try this : string t = "-r -c \"I am going to reboot your mechine\" -t 20"; Process process = new Process(); process.StartInfo.FileName = "shutdown.exe "; process.StartInfo.Arguments = t; process.Start(); I think this will solve your problem. Cheers Jijo

        F Offline
        F Offline
        fjlv2005
        wrote on last edited by
        #3

        Hi Jijo, Thanks for your reply. I guess i will just have to use shutdown.exe and continue using Process and ProcessStartInfo. More power to you!

        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