DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Windows NT / 2000 / XP (http://www.daniweb.com/forums/forum10.html)
-   -   How to shutdown remote pc from DOS? (http://www.daniweb.com/forums/thread17446.html)

BPembo Jan 22nd, 2008 1:24 pm
Re: How to shutdown remote pc from DOS?
 
It has been brought to my attention that there is an error in teh programming for my previous post. This version seems to work a bit better:


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 -r -t 0 -f -m \\" & strComputer

set objShell = CreateObject("WScript.Shell")

objShell.Run strShutdown

Wscript.Quit

thanks,
Brandon

Quote:

Originally Posted by BPembo (Post 473823)
Try this VBScipt. Copy and paste the below text in to notepad. then save it with the extension .vbs. Then when you double click it, it should give you an input box. What ever IP or PC name you enter there will be shut down!:

Sub RebootComputer( strServer )
Set objOSSet = GetObject("winmgmts:{(RemoteShutdown)}//" & strServer & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")

For each objOS in objOSSet
objOS.Reboot()
Next
End Sub


' *************************************************************
' Main
' **************************************************************
Dim strComputer
Do
strComputer = inputbox( "Please enter the name of the computer you want to reboot", "Input" )
Loop until strComputer <> ""

RebootComputer( strComputer )

WScript.Echo( "Computer " & strComputer & " rebooted" )


downloadsrk Aug 25th, 2008 7:23 am
Re: How to shutdown remote pc from DOS?
 
which OS U R using.

for windows xp/2000/2k3 it worked

shutdown /s /m \\<system ip address> /t <time>

<time> : it should be in seconds. For example 2 min = 120
<ip address> : target system ip address

for any quries pls reply to : downloadsrk@yahoo.com

NetworkExpert Nov 5th, 2008 11:16 pm
Re: How to shutdown remote pc from DOS?
 
There are others ways to make easier remote shutdown in a machine network, follow this link to download Easy Net Control a network administrator tool that help you to easy shutdown, logoff, restart send messages, and instructions to remote machines.

http://enc.idraconnectivesolutions.com/
http://enc.idraconnectivesolutions.com/

Or

http://idraconnectivesolutions.com/enc/
http://idraconnectivesolutions.com/enc/

I hope that this could help you.


All times are GMT -4. The time now is 7:15 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC