I'm trying to modify the work of a predecessor to improve our workflow. He used a shortcut to a *.bat file and *.exe to configure then start our heavily controlled engineering software. This works great for starting the program, but it means that we can't set the software as the default program to open the file type. This means we always have to open files through the engineering software's GUI, which is lacking in sorting and searching capabilities (critical in folders with thousands of engineering parts).
So currently, the shortcut goes to: %Sharedrive1%\bin\licenseconfig.bat engrCAD.exe
I figured maybe starting engrCAD.exe
from the .bat would allow me to use the .bat as a default editor by creating a .bat ConfigNLaunchEngrCAD.bat
which has the contents of the original .bat plus start "" engrCAD.exe
to the end of the .bat file. This worked in opening the program straight from the .bat, but still goes nowhere when I try to open a file in engrCAD through ConfigNLaunchEngrCAD.bat.
I think what I need to do is make the batch script able to take the file name as a parameter and pass it to the CAD software. But I can't find how to implement that. Is it a parameter I can add to the start command to accept the file name and directory selected? Or am I supposed to use a different command all together to accomplish this?
Much obliged, friends.
EDIT
I'm having trouble seeing the similarity with the other question. I'm looking for a way to run an exe after a .bat configuration through windows that will allow it to be set as a default program for a specific file type. The other post has similarities in the keywords "pass parameters" but little else in common. If I am wrong, I'm sorry, but I may need a little more help to see how the other solution is applicable to this situation.
This question is more similar, but instead of inputing the file name in cmd prompt, I want it to be able to get the file path from me opening the file in windows with the .bat as the default program.
@ECHO OFF SET var1=%1 engrCAD.exe %var1%