Hello again,
I'm running MS 11.1.08a and I have a question that I can't find documented anywhere. Sorry if this is a repeated question.
Is it possible for a compiled macro to get its own filename without knowing its location? Let's say I have an .exe compiled from MS named "hello.exe". Can the file, when run, get "hello" into a variable in some way?
Thanks, if you can help!
Utz
Can a MS .exe file get its own filename?
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, parse SCRIPT_FILE which contains the full path to the script or exe. E.g. compile this code and run it:
Code: Select all
Separate>SCRIPT_FILE,\,parts
Let>fname=parts_%parts_count%
Separate>fname,.,parts
Let>fname=parts_1
MessageModal>fname
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?