How to apply the commands in a batch file to a selected file from the context menu

Solution 1:

Two errors:

  • The context-menu command should be:

      C:\\script\\rename.bat "%1"
    
  • The line inside the batch file should be:

      cmd /c ren "%1" %ldt%%~x1