Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

vbscript shutdown remote computer

Set WSHShell = WScript.CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")

strWarning = "Due to network maintenance, this computer must be restarted. You have 5 minutes to save your work from the start of this countdown. Sorry for any inconvenience caused. "
strDelay = 300	'Delay given in seconds; change this value to your preference, or set it to 0 to give no delay at all

'Open a text file of computer names
'with one computer name per line
Set oTS = oFS.OpenTextFile("C:computers.txt")

'go through the text file
Do Until oTS.AtEndOfStream
 'get the next computer name
 'store it in variable strCompname
strCompname = oTS.ReadLine
		WshShell.Run "C:WindowsSystem32shutdown.exe -m " & strCompname & " -r -c " & Chr(34) & strWarning & Chr(34) & " -t " & strDelay	'Replace the "-r" switch with "-s" to make the computers shutdown instead
Loop
'close the text file
oTS.Close
Comment

PREVIOUS NEXT
Code Example
Python :: flask conditional according to urrl 
Python :: pip unknown command import 
Python :: tkinter lottery app 
Python :: vvm 2020 exam date 
Python :: Python program to read a random line from a file. 
Python :: pyqt5 messagebox settext 
Python :: python - from most_similar to ldictionary 
Python :: using django celery 5.0 
Python :: Only show legend of inner donut 
Python :: custom dense layer 
Python :: getting month number in python 
Python :: How to import modules in Python? 
Python :: clear-all-widgets-in-a-layout-in-pyqt 
Python :: Python Raw string using r prefix 
Python :: Pandas index column title or name 
Python :: kivy window location 
Python :: copy bdc to feature class arcpy 
Python :: python list comprehension exercises 
Python :: NLP text summarization with LSA 
Python :: python gambling machine 
Python :: get mismatch element in allclose numpy 
Python :: python loop take out element backwardly 
Python :: incrtease frame size legend 
Python :: how to choose appropriate graph for dataset visualization 
Python :: example of transformer 
Python :: Fill NaN with the first valid value starting from the rightmost column, then extract first column 
Python :: how to increase width of line in graph of linear regression in matplotlib 
Python :: how to set beutfull tkinter button 
Python :: i type nano in python and o get error 
Python :: cv2 open blank window 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =