View Single Post
Old 04-15-2021, 02:48 PM
cboyack cboyack is offline
VanDyke Technical Support
Join Date: Apr 2020
Location: Albuquerque, NM
Posts: 132
Originally Posted by dsp00k View Post
It is supposed to return the path of the running script so I can call a file that is located in the same directory as the script. i.e.
c:\users\donnie\scripts and then construct the full filename which is supposed to be something like "c:\users\donnie\scripts\9k.pp"

Sometimes it works properly, and most other times I get "c:\windows\system32\9k.pp" as the returned path instead, which of course leads to a File not Found.
This issue is most likely being caused by the fact that Current Directory can mean quite a number of different locations, depending on a multitudinous number of factors. As a result, you'll most likely need to use a different call if you want to consistently obtain the path of the script-containing folder.

Please see this forum post for options that may alleviate this problem.

For fun, you may want to try running the script code listed there as well, just to see how easily the current directory can change depending on context.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote