As of 04/09/2023, neither of these scripts work. ... so maybe we will have jobs for a bit longer.
generate Windows shortcuts with injected environment variables and a custom icon in the image formats PNG, JPEG, SVG, or ICO.
by
ChatGPT-4
human involved being@zudsniper
I absolutely despise
batchscripting, as it is in every way inferior tobashscripting. However, due to the fact that the target operating system for this script is ONLY windows users due to the windows specific Shortcuts being generated, I decided to cursorily include amake_shortcut.batfor any of you that are down so bad that you lack abashinterpreter likeMSYS2or usingWSL. My heart goes out to you; I do not know how you are still alive.
The batch script works in exactly the same way as the bash script, so if you for some god forsaken reason want to avoid bash, you may simply use make_shortcut.bat instead of ./make_shortcut.sh and all examples should work in the same way.
Replace ./make_shortcut.sh with the path to the script file.
./make_shortcut.sh [OPTIONS] EXECUTABLEThis table outlines all the command line flag options available for this script.
| Flag | Description |
|---|---|
--file (-f) |
Indicates that the environment variable argument is a file path. |
--env (-e) VALUE |
Specifies an environment variable or a file containing environment variables in the format VAR=VALUE. |
--icon FILE |
Specifies an icon file to use for the shortcut. The file must be in .ico, .jpg, .jpeg, .svg, or .png format. |
--help (-h) |
Display a help message with a list of options and example usage cases. |
This is a set of examples which will hopefully show some potential use cases for this script.
Create a shortcut for my_exe.exe with the environment variables VAR1=value1 and VAR2=value2:
$ ./make_shortcut.sh /path/to/my_exe.exe -e "VAR1=value1 VAR2=value2"Create a shortcut for my_exe.exe with environment variables from a file:
$ ./make_shortcut.sh /path/to/my_exe.exe -f -e /path/to/.envCreate a shortcut for my_exe.exe with an icon file:
$ ./make_shortcut.sh /path/to/my_exe.exe --icon /path/to/icon.pngCreate a shortcut for my_exe.exe with all options:
$ ./make_shortcut.sh /path/to/my_exe.exe -f -e /path/to/.env --icon /path/to/icon.icozod.tf
fullstack development, server administration, web design, branding creation, musical scoring, video editing, and idk another thing
Script is MIT Licensed.
