Getting the file name without extension in a Windows Batch Script

Change the action to call a batch file:

RunCompressor.bat "%1"

Use %~n1 to get the filename without the extension in RunCompressor.bat:

start javaw.exe -jar yuicompressor-2.4.2.jar -o "%~n1.min.js" "%1"

Helpful article

start javaw.exe closes the command window when running the batch file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)