Introduction: Python Program/Script to Stop Windows Applications/Shutdown Computer

Picture of Python Program/Script to Stop Windows Applications/Shutdown Computer

# Program that will stop common Windows applications and shut the computer down
# For the truly lazy. :-)

print ("Stopping applications now")
# import the operating system module
# allows user to run operating system commands from Python
import os
# Run the command "taskkill" to stop applications in Windows
os.system("taskkill /f /im notepad.exe")
os.system("taskkill /f /im winword.exe")
os.system("taskkill /f /im excel.exe")
os.system("taskkill /f /im powerpnt.exe")
os.system("taskkill /f /im outlook.exe")
os.system("taskkill /f /im chrome.exe")
os.system("taskkill /f /im calc.exe")
os.system("taskkill /f /im iexplore.exe")
os.system("taskkill /f /im powershell.exe")
os.system("taskkill /f /im wordpad.exe")

# use the template below to add more applications
# os.system("taskkill /f /im [executable name].exe")
# shutdown the computer in 1 second
os.system("shutdown /s /t 1")


About This Instructable




Bio: Occupation: Tech Support
More by matt392:2nd Method - Using Hole Saw Without ArborUsing Hole Saw Without ArborBox for Raspberry Pi Model B and Power Supply Made From Wood Shims
Add instructable to: