windows shortcut with relative path to the icon

↘锁芯ラ 提交于 2019-12-12 11:11:13

问题


Is there a way to set relative path to the icon in win shortcut? for the target location it works fine:

%windir%\system32\cmd.exe /c "cd %CD% && start fileToExecute.bat"

I read that win shortcuts can pick up icon from .exe files automatically but what to do if my target file is a batch file?


回答1:


It's not entirely clear what you're asking, since your title says one thing but your question says another.

if the question is whether it is possible to set a relative path for the icon location in a LNK file, then the answer is no. The icon file format has two ways of specifying the icon location, either as an absolute path or as a path with environment variables expanded. There is no option for a relative path.




回答2:


Disclaimer: This probably isn't a good question for StackOverflow, but I am new here, so I don't know...

  • Create shortcut to .bat file.
  • Right click on the file.
  • Click Properties.
  • Click "Change Icon..."
  • You see an error that says the bat file doesn't have icons. Press Ok.
  • Browse for your icon.


来源:https://stackoverflow.com/questions/14695607/windows-shortcut-with-relative-path-to-the-icon

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!