[James Carroll] | Hi, I would like to invoke the same shortcut editor that you get when | you right cilck on a shortcut (link) and choose Properties. It lets | you edit the Target and Start In directories, etc. | | I've tried: | win32api.ShellExecute (0, "Properties", filename, | None, ".", 0 ) | win32api.ShellExecute (0, "Edit", filename, None, ".", 0 ) | Where filename is the .lnk file But I get a permissions error with the | "Edit" and no response from "Properties"
No great expertise here, but from this: http://vbnet.mvps.org/index.html?code/shell/propertypage.htm I guessed into Python like this: <code> from win32com.shell import shell, shellcon # # Be warned, shell fns do *not* accept # forward-slash filepaths # filename = r"c:\temp\test.lnk" # # Done this way to avoid line-wrap probs in email # flags = shellcon.SEE_MASK_NOCLOSEPROCESS flags |= shellcon.SEE_MASK_INVOKEIDLIST flags |= shellcon.SEE_MASK_FLAG_NO_UI pidl, ignore = shell.SHILCreateFromPath (filename, 0) shell.ShellExecuteEx (flags, 0, "Properties", "", "", "", 0, pidl, "", 0, 0, 0, 0) </code> It's pretty crude, and I'm not sure where you'd go from there, but it does work. TJG ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32