+ Reply to Thread
Results 1 to 2 of 2

Thread: Shutdown Computer

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    10

    Shutdown Computer

    I want to shutdown computer using a vb script , is it possible ?

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    15
    Yes indeed it can be done , please refer to that code :
    Code:
    Dim objShell, strComputer, strInput 
    Dim strShutdown 
    
    Do 
    strComputer = (InputBox(" ComputerName to shutdown", "Computer Name")) 
    If strComputer <> "" Then 
      strInput = True 
    End if 
    Loop until strInput = True 
    
    strShutdown = "shutdown -s -t 0 -f -m \\" & strComputer 
        set objShell = CreateObject("WScript.Shell") 
       objShell.Run strShutdown 
    
    Wscript.Quit

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts