1.

Solve : Drag and Drop batch file?

Answer»

I want to make a simple batch FILE that will let me drag a file to it and rename it.

IF *.jpg NEQ A.jpg GOTO 1
IF *.jpg EQU A.jpg goto end
:1
ren *.jpg A.jpg
goto end
:end
exit

This script works if you CLICK on the batch file, but no drag and drop.Could someone TELL me what I'm missing.

ThanksThis may make your code generic enough:

Code: [Select]IF %~n1.jpg NEQ A.jpg goto 1
IF %~n1.jpg EQU A.jpg goto end
:1
ren %~n1.jpg A.jpg
goto end
:end
exit



Discussion

No Comment Found