0 votes

Hello everyone! I would very much like to know how to open a folder for a year. I mean, I want that when you press the button, you open the system explorer in the folder specified by the code. I have a folder located at user:// - we searched for many hours and cannot find it, probably no one is interested in this issue. Thanks for any help!

Всем привет! Я б хотел очень сильно узнать как открыть папку на годот. Всмысле я хочу,что бы при нажатии кнопки у вас открылся системный проводник в заданной кодом папке. У меня есть папка которая располагается по адресу user:// - мы искали много часов и не можем найти,вероятно,никто не интересуется данным вопросом. Спасибо за любую помощь!

Godot version 3.3.1
in Engine by (49 points)

1 Answer

0 votes
Best answer

To open user:// folder with explorer (assuming that you use Windows OS) you need to use OS.execute method to execute command in cmd and OS.get_user_data_dir method to get absolute path to user:// folder. The following code will open user:// folder in explorer:

OS.execute("start", ["\"\"", OS.get_user_data_dir()])
by (1,650 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.