Reputation: 86727
How can I use a cmd batch command to find a filename using wildcard matching?
I want to run the following, where the wildcard should match the one file that is contained in the dir:
SET FILENAME=c:\my-example-file-*.jar
java -jar %FILENAME%
Upvotes: 0
Views: 131
Reputation: 175766
If you know there is always one, just use a listing:
FOR %%F IN (c:\my-example-file-*.jar) DO java -jar %%F
Upvotes: 1