Search code examples
operating-systemgodotgdscript

create shortcut using gdscript


How do I create a desktop shortcut for a specific file using gdscript What I mean is that I have a program with the extension .exe and I want to create a shortcut on the desktop automatically using gdscript It is enough to give me a function that receives the path of the .exe file as input and creates a shortcut for it on the desktop


Solution

  • Godot does not have this functionality.


    Since you say ".exe", I'm assuming this is for Windows.

    I suggest you look up how to create a shortcut from command line (e.g. How to make a shortcut from CMD? or How do I create a shortcut via command-line in Windows?), and then use OS.execute or OS.create_process to run that.

    Note: you are going to get some results about making a Symbolic link, which is not the same think as a Shortcut.