Print the file name with another extension (Batch-program)

Posted by Semyon Perepelitsa on Super User See other posts from Super User or by Semyon Perepelitsa
Published on 2010-04-17T07:08:16Z Indexed on 2010/04/17 11:43 UTC
Read the original article Hit count: 289

Filed under:
|
|
|

Batch-program launchs with 1 parameter (full path to file)

program.cmd "C:\Path\To\File\Filename.txt"

Now, this program consists of 1 command:

echo %1

And it just prints an argument: C:\Path\To\File\Filename.txt for the upper example.

But I want it to print an argument (full path) with another extension, e.g. .exe. For the upper example, I want it to print C:\Path\To\File\Filename.exe.

How to make it do that?

© Super User or respective owner

Related posts about Windows

Related posts about batch