I use Wondershare Filmora for video recording and am generally satisfied with it. I have it installed on multiple computers. However, because the installation locations differ and Filmora updates frequently (with the version number, like 14.4.3.11809, included in the installation folder path), and I prefer launching it via a batch file from the command line, I constantly had to modify the version number in the batch file, which was quite annoying. Today, I finally modified the launch script, hoping I won't have to change it again.
Initially, I wanted to handle the detection and execution entirely within the fm14.bat batch file, but after trying for a while, I found it too troublesome. Ultimately, I resolved it using a simpler VBScript.
1. fm14.bat
- Use the command-line interface es.exe of the Everything search engine to find
filmora.exeon the hard drive. - Pass the output found by
es.exetofilmora-exec.vbs.
▼ fm14.bat
@echo off
for /f "tokens=*" %%i in ('es -w -r "^filmora.exe$"') do set FILMORA=%%i
cscript.exe c:\util\filmora-exec.vbs "%FILMORA%"
2. filmora-exec.vbs
- Parse the data passed from
es.exe, look forC:orD:, store the execution path in thefilenamevariable, and finally executefilename.