Skip to content

Commit

Permalink
shelllink.py does not need to be executable (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech authored Nov 10, 2024
1 parent 083c19e commit 2b411e5
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions comtypes/shelllink.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,26 +317,3 @@ class ShellLink(CoClass):
_reg_clsid_ = GUID("{00021401-0000-0000-C000-000000000046}")
_idlflags_ = []
_com_interfaces_ = [IShellLinkW, IShellLinkA]


if __name__ == "__main__":
import sys
import comtypes
from comtypes.client import CreateObject
from comtypes.persist import IPersistFile

shortcut = CreateObject(ShellLink)
print(shortcut)
##help(shortcut)

shortcut.SetPath(sys.executable)

shortcut.SetDescription("Python %s" % sys.version)
shortcut.SetIconLocation(sys.executable, 1)

print(shortcut.GetPath(2))
print(shortcut.GetIconLocation())

pf = shortcut.QueryInterface(IPersistFile)
pf.Save("foo.lnk", True)
print(pf.GetCurFile())

0 comments on commit 2b411e5

Please sign in to comment.