Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created February 22, 2012 18:07
Show Gist options
  • Save jehoshua02/1886381 to your computer and use it in GitHub Desktop.
Save jehoshua02/1886381 to your computer and use it in GitHub Desktop.
Launches everything in ./shortcuts/ folder
# purpose: open all files in a directory as if each were double-clicked
# allowing the user to throw a bunch of program shortcuts into a
# directory and run this script to open them all.
# imports
import os
# declarations
shortcuts = os.getcwd() + '/shortcuts'
files = os.listdir(shortcuts)
# open each file in shortcuts
os.chdir(shortcuts)
for file in files:
try:
os.startfile(file, 'open')
except:
print "nope"
# open shortcuts for customizing
os.startfile(shortcuts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment