Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a variable for the file you open the CMD file with?

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>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%
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading