# Switch to mounted filesystem automatically

**URL:** <https://discourse.appimage.org/t/switch-to-mounted-filesystem-automatically/1867>\
**Category:** Creating AppImages\
**Created:** [October 30, 2020, 6:30am UTC](https://discourse.appimage.org/t/switch-to-mounted-filesystem-automatically/1867 "2020-10-30T06:30:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![squidink7](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@squidink7](https://discourse.appimage.org/u/squidink7)\
**Post date:** [October 30, 2020, 6:30am UTC](https://discourse.appimage.org/t/switch-to-mounted-filesystem-automatically/1867/1 "2020-10-30T06:30:38Z")

</div>

Whenever I make an AppImage using appimagetool I need to add the line `cd "(dirname "$0")"` if I want to execute other files in the AppDir which only works if the AppRun is made as a bash script, also it seems clunky having to type that every time I need to make a new appimage. Would it be possible to make it automatically switch to the location that is mounted? this would make interacting with other relative files much easier. Or I could be missing something crucial (I only learned how to make appimages by trial and error anyway) if so please tell me.

---

<div class="post-metadata">

**Author:** ![squidink7](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@squidink7](https://discourse.appimage.org/u/squidink7)\
**Post date:** [November 1, 2020, 4:52am UTC](https://discourse.appimage.org/t/switch-to-mounted-filesystem-automatically/1867/2 "2020-11-01T04:52:06Z")

</div>

Edit: Never mind, I just found out about the $APPDIR variable which makes things much easier. As suspected it just was me missing something in the documentation. 😛
