That's actually the approach that I've been working on today. But it's implementation is a little more complicated if you must allow for any type of Origin installation. The complications arise from two possible situtations:- Long file names - If the Origin's path is C:\Origin Program Folder\Origin61.exe, then %Y=C:\Origin Program Folder\ will look like three arguments when passed to the batch program. The simple solution is to enclose %Y in quotation marks.
- Partitioning, or muliple drives - If you just opened a project on a different drive letter, say E:\Projects, then you must change back to the drive containing Origin before switching to its program directory.
I've settled on this approach: run -e filename.bat %[%Y,3] "%Y";
and start the batch program with these two lines: %1
cd %2
For the Origin path in my example this becomes C:
cd "C:\Origin Program Folder\"
This works well, but some of my batch programs already have several arguments and I was looking for a way to avoid adding two more. But that's probably more a matter of taste than anything else.
Thanks,
Mike Buess
Origin WebRing Member