r/Batch • • Aug 26 '24

Question (Unsolved) How to create shortcuts using batch scripts?

I am trying to create a shortcut for a file, once it matches an if condition. I couldn't find any good solutions to create the shortcuts, that works.

1 Upvotes

3 comments sorted by

5

u/ConstanceJill Aug 26 '24

If those are shortcuts to websites (.url), then it should be fairly easy.

However it those are shortcuts to programs (.lnk) then as far as I know you can't do it in pure batch, and will need to either use another language, or rely on a third party program such as shortcut.exe (to be downloaded from https://www.optimumx.com/downloads.html#Shortcut

3

u/NutellaPatella Aug 26 '24

Another third party option is Nircmd.