Squashman wrote:I have people who use my Drag and Drop batch files by putting them into their SendTo Context Menu. Is this different then making a direct Context menu? Putting the batch file in the Sendto looks to have the same problem with the Ampersand.
If you use the first method in that context menue, you have no file group call (like with "SendTo"), but multiple single file calls to "C:\Test.bat" (example below).
So there should be no problem in computing the parameter file name (just use the doublequoted call format):
"My Item.reg":
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\My Item\Command]
@="C:\\Test.bat \"%1\""
"C:\Test.bat"
Code: Select all
@echo off
set "fileName=%~1"
setlocal enableDelayedExpansion
echo(!fileName!
pause
endlocal
goto :eof
penpen