My CMD file:
java -jar unluac.jar unluac.lua > unluac_decompiled.lua
So in my CMD file, I have to manually change the name of the file I want unluac(.jar) to decompile. Now what I want is to be able to say something like this:
java -jar unluac.jar [var].lua > [var]_decompiled.lua
where VAR would be the file i drag onto the CMD file.
CodePudding user response:
When you drag-and-drop a file onto one with a cmd extension, the name of the dropped file is passed as the first parameter. So, assuming this will always be files with an "lua" extension, you could do:
@echo off
java -jar unluac.jar %1 > %~n1%_dec.%~x1%