Find a file extension

62 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 answers

2
Brian H On

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

dir file.txt.* /s /p