I have a batch file that performs certain operations and at the end, it copies (using a simple "copy" command) an .lnk file to "%ALLUSERSPROFILE%\Desktop". It used to work just fine, up until Windows 10. In there, when the copy command is executed, it returns an "access denied" error (even with Run As Admin and given the fact that the user executing it is already a local admin).
After some internet search, i found that this is due to security reasons implemented in Win10. There were some suggestions to use "%ALLUSERSPROFILE%\Public Desktop" instead, because in Win10, that's the "all users desktop" dir. I tried that. It did not return an error but also did not copy the file.
I also considered PowerShell, but it seems there are security restrictions there which make the successful execution of a script uncertain.
The shortcut is not a simple one (the exe is on a network path, it has parameters after the exe and also an icon from an external library, not from the exe itself) so somehow creating it would probably be rather tricky. It would be preferable to just copy it. Are there other options to somehow copy it to the Public Desktop? If there are no alternatives, are there any other ways that can be used in order to successfully create that shortcut without raising any security flags? Please, no GPO solutions, i would like to be able to achieve this within the batch file or perhaps with an external command / utility (preferably at no-cost). Also, assume that the user performing this procedure will always be a local admin.