# How to get 'Start in' directory path

**URL:** <https://clarionhub.com/t/how-to-get-start-in-directory-path/6737>\
**Category:** questions\
**Tags:** windows\
**Created:** [October 30, 2023, 11:32am UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737 "2023-10-30T11:32:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kotresha](https://clarionhub.com/user_avatar/clarionhub.com/kotresha/32/3677_2.png) [@kotresha](https://clarionhub.com/u/kotresha)\
**Post date:** [October 30, 2023, 11:32am UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/1 "2023-10-30T11:32:47Z")

</div>

Hi,

My attachment files polling to the 'Target directory' as a normal practice. But i wanted to poll into 'Start in' directory path. Hence i would need to locate/find the 'Start in' directory path. Your suggestions would be much appropriated in advance. Thanks

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [October 30, 2023, 1:26pm UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/2 "2023-10-30T13:26:52Z")

</div>

You can get the current directory at anytime using LONGPATH() or PATH()  
So call either of those before you change directories to get the start in path.

On a semi related subject:  
You can call COMMAND(‘0’) to get the path of the program that’s running.  
( note: that’s a zero )

> Help[Command]  
> “…  
> A flag of ‘0’ returns the minimum path the operating system used to find the command.  
> …”

---

<div class="post-metadata">

**Author:** ![kotresha](https://clarionhub.com/user_avatar/clarionhub.com/kotresha/32/3677_2.png) [@kotresha](https://clarionhub.com/u/kotresha)\
**Post date:** [October 30, 2023, 1:54pm UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/3 "2023-10-30T13:54:46Z")

</div>

Thanks Mark. COMMAND(‘0’) returns Path of the Target folder with file.exe . I am looking for Start in:  
Still exploring…

 ![image](https://clarionhub-uploads.s3.eu-north-1.amazonaws.com/original/2X/2/2cd4496a2ec9393d8cbf0b8be8f6be3673081298.png)

---

<div class="post-metadata">

**Author:** ![Rick\_UpperPark](https://clarionhub.com/user_avatar/clarionhub.com/rick_upperpark/32/346_2.png) [@Rick\_UpperPark](https://clarionhub.com/u/Rick_UpperPark)\
**Post date:** [October 30, 2023, 2:17pm UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/4 "2023-10-30T14:17:37Z")

</div>

> [@MarkGoldberg](#):
>
> You can get the current directory at anytime using LONGPATH() or PATH()

Mark did say this. Use LONGPATH() as soon as your program starts and the current path will be the “Start In” path.

---

<div class="post-metadata">

**Author:** ![kotresha](https://clarionhub.com/user_avatar/clarionhub.com/kotresha/32/3677_2.png) [@kotresha](https://clarionhub.com/u/kotresha)\
**Post date:** [October 31, 2023, 2:37pm UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/5 "2023-10-31T14:37:59Z")

</div>

Sorry, i was looking for ‘Start in’ path for ‘Data set’ where the ‘Target’ dir path is different from ‘Start in’ dir path. Thanks

---

<div class="post-metadata">

**Author:** ![Olivier](https://clarionhub.com/letter_avatar_proxy/v4/letter/o/d2c977/32.png) [@Olivier](https://clarionhub.com/u/Olivier)\
**Post date:** [October 11, 2024, 5:19pm UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/6 "2024-10-11T17:19:12Z")

</div>

Hi,

I’m not sure to understand what you are looking for, but it looks like you’re trying to read the data from the shortcut (right click on the program icon placed on the desktop, then click on properties)

These shortcuts are .lnk files, I’m not sure we can open them easily and read their content…  
the program does not know nothing about the shortcut, it is the shorcut which knows where the program is located and where (in which directory) it should start.

From another point, we can tell our Clarion programs where the data is located using the SYSTEM{Prop:DataPath} property.

From the help file

PROP:DataPath

A read/write SYSTEM property that can be used to set the default directory for data files.

All files with unqualified file names (e.g., those files with no NAME attribute or a NAME with only a relative path) will be looked for in the directory specified by SYSTEM{PROP:DataPath}.

SYSTEM{PROP:DataPath} defaults to the directory the application starts in. This will save developers from having to do startup code like the following:

GETINI(datadirectory)  
file1name = datadirectory & ‘file1’  
file2name = datadirectory & ‘file2’  
file3name = datadirectory & ‘file3’

---

<div class="post-metadata">

**Author:** ![Julian](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@Julian](https://clarionhub.com/u/Julian)\
**Post date:** [October 12, 2024, 1:52pm UTC](https://clarionhub.com/t/how-to-get-start-in-directory-path/6737/7 "2024-10-12T13:52:16Z")

</div>

Is this what you’re after ..  
[https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcurrentdirectory](https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcurrentdirectory)
