Следуя этому вопросу, я остановился на следующем коде Python для изменения ярлыков Windows.
Это работает для ярлыков на английском языке, но не для ярлыков на основе Юникода.
Как можно изменить этот (или любой другой) фрагмент для поддержки Unicode?
import re, os, pythoncom
from win32com.shell import shell, shellcon
shortcut_path = os.path.join(path_to_shortcut, shortcut_filename)
shortcut = pythoncom.CoCreateInstance (shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink)
persist_file = shortcut.QueryInterface (pythoncom.IID_IPersistFile)
persist_file.Load (shortcut_path)
destination1 = shortcut.GetPath(0)[0]
destination2 = os.path.join(destination_path, destination_filename)
shortcut.SetPath(destination2)
persist_file.Save(shortcut_path, 0)
Предположим, что следующие символы являются юникодными: path_to_shortcut
, shortcut_filename
, destination_path
, destination_filename
shell
классов? Может быть, вопрос следует распространить на использование Unicode вообще, а не только для ярлыков Windows? - person Hnatt   schedule 03.08.2011