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.
>Solution :
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
set X=%1
set X=%X:.lua=_dec.lua%
java -jar unluac.jar %1 > %X%
