# Using File::hostApplicationPath in a non-plugin context

**URL:** https://forum.juce.com/t/using-file-hostapplicationpath-in-a-non-plugin-context/45714
**Category:** General JUCE discussion
**Created:** [April 26, 2021, 1:21pm UTC](https://forum.juce.com/t/using-file-hostapplicationpath-in-a-non-plugin-context/45714 "2021-04-26T13:21:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)
#### Post date: [April 26, 2021, 1:21pm UTC](https://forum.juce.com/t/using-file-hostapplicationpath-in-a-non-plugin-context/45714/1 "2021-04-26T13:21:13Z")

</div>

For some code, shared between plugin and non-plugin projects, I want to get the file name of the process – in case it’s a plugin it should be the host process’ file name, in case it’s a standalone, it should be the name of that standalone’s file name.

From looking at the macOS and Windows implementation, `juce::File::getSpecialLocation (juce::File::hostApplicationPath)` should do the job in both situations, but the docs only say

> In a plugin, this will return the path of the host executable.

but say nothing about what happens if not called in a plugin. So, is this intentional, should I not rely on this function to work outside of a plugin? Otherwise, could the behaviour when not used in a plugin be documented?
