Find a file extension

57 Views Asked by At

We hold a file on a server where we store a version number. Now we update the file extension with that version number (not my choice and not something I can change).

So what I need to be able to do in a batch file is to read that file extension. I know the path to the file and the filename, but need to be able to determine what the extension currently is.

1

There are 1 best solutions below

2
On

you can search with a wildcard character * to find the file

dir file.txt.* /s /p