How can I move a shortcut in a BAT file?

I have the following line in a BAT file, it does not work, how can I make it work? The shortcut is in the same directory as the BAT file, I have to move it to the desktop.

MOVE "MyShortCut.Ink" C:\ 
+4
source share
3 answers

shortcuts have the extension .LNK ("LINK"). You have an INK , as in "my pen broke and spilled ink on top of my shirt."

+7
source

On Windows, C:\ not a desktop. C:\Users\[Username]\Desktop usually what you are looking for.

There is an environment variable for C:\Users\[Username] for the current user, which is in the %USERPROFILE% state.

+4
source

If you started it from another directory, first switch to bat files that start the path;

 CD %~dp0 MOVE "MyShortCut.Lnk" "%USERPROFILE%\Desktop" 
+1
source

Source: https://habr.com/ru/post/1391879/


All Articles