Dragging a file from anywhere onto a batch file that creates a shortcut to that file at a specific directory

Solution 1:

This batch script creates a temporary VBScript in the %temp% folder. Would this be the expected result?

@echo off

if /i not exist "%~1" exit

set SDestination=d:\ScenaryPhotos

If /i not exist "%SDestination%" md "%SDestination%"
pushd "%SDestination%"

echo strTargetPath="%~nx1.lnk">"%temp%\tempvbs.vbs" 
echo Dim objShortcut, objShell>>"%temp%\tempvbs.vbs"
echo Set objShell = WScript.CreateObject ("Wscript.Shell")>>"%temp%\tempvbs.vbs"
echo Set objShortcut = objShell.CreateShortcut (strTargetPath)>>"%temp%\tempvbs.vbs"
echo objShortcut.TargetPath = "%~1">>"%temp%\tempvbs.vbs"
echo objShortcut.WorkingDirectory = "%SDestination%">>"%temp%\tempvbs.vbs"
echo objShortcut.Save>>"%temp%\tempvbs.vbs"
echo WScript.Quit>>"%temp%\tempvbs.vbs"

"%temp%\tempvbs.vbs"
del /q "%temp%\tempvbs.vbs"
exit

enter image description here