Last active
September 3, 2018 23:24
-
-
Save josephernest/468c772ee0ac313abf6da1a001590f71 to your computer and use it in GitHub Desktop.
mklinkgui - make symbolic links in Windows Explorer with context menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32clipboard # pip install pywin32 if needed | |
import sys, os, subprocess | |
fname = sys.argv[1] | |
win32clipboard.OpenClipboard() | |
filenames = win32clipboard.GetClipboardData(win32clipboard.CF_HDROP) | |
win32clipboard.CloseClipboard() | |
for filename in filenames: | |
base = os.path.basename(filename) | |
link = os.path.join(fname, base) | |
subprocess.Popen('mklink %s "%s" "%s"' % ('/d' if os.path.isdir(filename) else '', link, filename), shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment