The situation is: bat is a technology that has been carried forward from a time before when windows existed; which is at least partially why it's struggling to accomplish the task that you're asking it to do.
You might be able to do something creative with a FOR loop through the files to pick out the one you're looking for; however if you are not restricted to a bat solution, then it is going to be a whole lot easier to use a more modern ps1 solution:
Then you can- right click in the folder
- select New>Shortcut
- fill in the target input box with: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy RemoteSigned -File "Open-CurrentTestXLSB.ps1"
- click Next
- fill in the name input box with something useful like: Open Test.xlsb
- click Finish
- right click the new shortcut
- select Properties
- clear out the "Start In:" input box
- if you like you can click on Change Icon, and update that as well
- click OK
Now you should have a runnable shortcut to the ps1 similar to how you had an exe with your personal icon.
Note:- You may have to adjust the '.\test\BASIC\' in the ps1 file to be the correct folder to look in.
- It doesn't currently find test.xlsb, but you could rename that to test0.xlsb and it would find it.
Bookmarks