File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ from Tkinter import *
2+ import subprocess
3+ import os
4+ #tkinter import - os are libraries that are called into play to all us to use subprocess, check_call and frames
5+ master = Tk ()
6+ master .title ("Jarvis Support Tool" )
7+ master .geometry ("300x100" )
8+ #Popen allows for the use of Win Dos commands to run
9+ #cmd calls cmd.exe
10+ #/K tells cmd.exe to run the next commands
11+ #del bla bla bla deletes all* temp files that are not in use
12+ def cleanTemp ():subprocess .Popen (['cmd' , '/K' , 'del /q/f/s %TEMP%\*' ])
13+ def cleanDisk ():subprocess .check_call (['cleanmgr.exe' , '/d' , '/sagerun:1' ])
14+ #Check_call looks for the program and runs it with what ever options after commas
15+ #Below are variables that buttons are being stored into and the .pack is "Embedding" the code per se
16+ b = Button (master , text = "Clean Temp Files" , command = cleanTemp )
17+ b .pack ()
18+ c = Button (master , text = "Clean Disk" , command = cleanDisk )
19+ c .pack ()
20+ mainloop ()
21+ #mainloop here makes this whole process stay alive even after an option is selected. Otherwise it would close upon button selection
22+ #Developed by JM
You can’t perform that action at this time.
0 commit comments