I'm trying to search for a file that ends with *.ac and open that file in a program. There will always just be one file with this extension. The directory where the bat file will search is always the directory where it's running from.
Currently this works:
@echo off
for /r "%CD%" %%a in (*) do if "%%~nxa"=="myFileName.ac" set p=%%~dpnxa
start /d "C:\Program Files (86)\CaseWare\" cwin32.exe "%p%"
But the myFileName.ac will always have a different name.
I tried to change it to *.ac but then it doesn't work :(
@echo off
for /r "%CD%" %%a in (*) do if "%%~nxa"=="*.ac" set p=%%~dpnxa
start /d "C:\Program Files (86)\CaseWare\" cwin32.exe "%p%"
Any help please?