I recognize that the issue here is more likely to do with the bat file itself rather than the right click -> Send To -> shortcut to bat file so here goes...
I wanted to implement the bat file code found here
The idea being that the user selects a bunch of files in a folder, right clicks, and can send the files to the bat file to create a list of file names.
So I created the bat file, create a shortcut to the bat file. placed the shortcut into my send to folder and the Send To option to the bat file appears as expected.
However, when I select a bunch of files (or even just one) and right click - Send To - bat file, windows explorer will blink as if doing something but no txt file generates. See below for my exact file contents:
@echo off
set "OutputFile=C:\Users\Paul\Desktop\FileNames.txt"
del "%OutputFile%" 2>nul
:NextFileName
if not "%~1" == "" (
echo %~nx1>>"%OutputFile%"
shift
goto NextFileName
)
if exist "%OutputFile%" (
%SystemRoot%\System32\sort.exe "%OutputFile%" /O "%OutputFile%"
)
So what is wrong?