The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Origin's current directory & run -e

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mike Buess Posted - 06/29/2001 : 08:32:57 AM
I'm looking for a way to change the current directory while Origin is running and I want to do so without opening a project or any other Origin file. I often launch batch programs with 'run -e' and usually want their working directories to be the Origin program folder. Instead the batch program's working directory is Origin's current directory as described above. Now I am changing directories (cd) within the batch programs and explicitly write in the Origin path. But the batch programs are used in an add-on and the path must be rewritten for each user during setup. It would be easier if I could simply change Origin's current directory prior to launching the batch program. Is that possible?

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/29/2001 08:34:26

Edited by - Mike Buess on 06/29/2001 12:36:13
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/29/2001 : 4:57:58 PM
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
rtoomey Posted - 06/29/2001 : 3:54:53 PM
What about passing each path as a string variable? For instance, you can pass the path to the Origin directory by executing the run -e as follows:

run -e filename.bat %Y;

The string in %Y would then get passed into the batch file as %1. Similarly, the default path for Origin projects could be obtained and passed:

fdlog.useGroup(Origin);
%A=fdlog.path$;
run -e filename.bat %A;
(** See Note **)

Both could be passed, too:

fdlog.useGroup(Origin);
%A=fdlog.path$;
run -e filename.bat %A %Y;


In this case, the paths would be held as follows:
1) Origin projects path: %1
2) Origin directory path: %2

I hope this helps. If this was not (in any way) what you were asking, please let me know!

- rtoomey



** Note ** %Y is a reserved string variable which always holds the path to the Origin directory. Check out the LabTalk Help file or Origin User's Manual to learn about it.




The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000