%UserProfile%\Desktop is wrong!!! Never use it
Special folders can be moved around easily, that's why there are registry entries for them, otherwise we'd just need to hard code them everywhere. Even Windows could be installed into a different folder/drive than C:\Windows and Program Files can be changed. Same to Documents, Pictures, Desktops... Nowadays Windows tend to enable OneDrive backup by default and user special folders will not be in the user's home path anymore. And even the OneDrive folder path can be changed

See %USERPROFILE%/Desktop no longer valid after relocating Desktop folder to OneDrive
To get the path reliably you'll need to call this by running the below command in PowerShell
[Environment]::GetFolderPath([Environment+SpecialFolder]::Desktop)
Alternatively you can run this in PowerShell
(New-Object –ComObject Shell.Application).namespace(0x10).Self.Path
0x10 here is the Shell Special Folder Constant for desktop
Another PowerShell way:
$c = New-Object -ComObject Wscript.Shell
$c.SpecialFolders("Desktop")
The above last 2 solutions deal with COM objects so they can be written in pure VBS or Js, or even hybrid batch-VBS/Js. For example pure VBS solution of the above:
Set oShell = CreateObject("Wscript.Shell")
Set oSFolders = oShell.SpecialFolders
WScript.Echo oSFolders("Desktop")
Hybrid batch/Js solution of the second snippet
@if (@CodeSection == @Batch) @then
@echo off
cscript //e:jscript //nologo "%~f0" %*
exit /b
@end
// JScript Section
WScript.Echo((new ActiveXObject("shell.application")).namespace(0x10).Self.Path);
From a batch file you can call PowerShell to get the path if you don't want the hybrid solution above
powershell -C "[Environment]::GetFolderPath([Environment+SpecialFolder]::Desktop)"
The "pure" batch solution is much trickier because you'll have to parse multiple registry keys
@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "DesktopFolder="
for /F "skip=1 tokens=1,2" %%I in ('%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop 2^>nul') do if /I "%%I" == "Desktop" if not "%%~K" == "" if "%%J" == "REG_SZ" (set "DesktopFolder=%%~K") else if "%%J" == "REG_EXPAND_SZ" call set "DesktopFolder=%%~K"
if not defined DesktopFolder for /F "skip=1 tokens=1,2" %%I in ('%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Desktop 2^>nul') do if /I "%%I" == "Desktop" if not "%%~K" == "" if "%%J" == "REG_SZ" (set "DesktopFolder=%%~K") else if "%%J" == "REG_EXPAND_SZ" call set "DesktopFolder=%%~K"
if not defined DesktopFolder set "DesktopFolder="
if "%DesktopFolder:~-1%" == "" set "DesktopFolder=%DesktopFolder:~0,-1%"
if not defined DesktopFolder set "DesktopFolder=%UserProfile%\Desktop"
echo Desktop folder is: "%DesktopFolder%"
endlocal