# App Loader Manager - from Tkinter import * import pickle, tkFileDialog, os # Set up the main window root = Tk() root.geometry("600x400") root.title("App Loader") # Functions def PickApp(): filename = tkFileDialog.askopenfilename() applist.insert(END, filename) def RemoveApp(): applist.delete(ANCHOR) def Save(): f = file("appsload.db", "wb") apps = applist.get(0, END) pickle.dump(apps, f) def Enable(): batcontents = os.getcwd()+"\\apploader.exe" out_file = open("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/AppLoader.bat", "w") out_file.write(batcontents) out_file.close() def Disable(): try: os.path.exists("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/AppLoader.bat") and os.path.isfile("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/AppLoader.bat") os.remove("C:/Documents and Settings/All Users/Start Menu/Programs/Startup/AppLoader.bat") except: pass def DeleteCurrent(event): Remove() # Set up the interface textframe = Frame(root) listframe = Frame(root) pickapp_button = Button(textframe, text="Pick App", command = PickApp) removeapp_button = Button(textframe, text="Remove App", command = RemoveApp) save_button = Button(textframe, text="Save", command = Save) enable_button = Button(textframe, text="Enable", command = Enable) disable_button = Button(textframe, text="Disable", command = Disable) scrollbar = Scrollbar(listframe, orient=VERTICAL) applist = Listbox(listframe, yscrollcommand=scrollbar.set, selectmode=EXTENDED) scrollbar.configure(command=applist.yview) # Bind keyboard/mouse events to actions applist.bind("", DeleteCurrent) # Populate the window pickapp_button.pack(side=LEFT) removeapp_button.pack(side=LEFT) save_button.pack(side=LEFT) enable_button.pack(side=LEFT) disable_button.pack(side=LEFT) applist.pack(side=LEFT,fill=BOTH, expand=1) scrollbar.pack(side=RIGHT, fill=Y) textframe.pack(fill=X) listframe.pack(fill=BOTH, expand=1) # Try loading the current app list try: f = file("appsload.db", "rb") apps = pickle.load(f) for item in apps: applist.insert(END, item) f.close() except: pass # Run the program root.mainloop() # App Loader import os, pickle try: f = file("appsload.db", "rb") apps = pickle.load(f) f.close() for item in apps: os.startfile(item) except: pass