I am looking to take a .exe file I've built using cx_Freeze, move it to my desktop, and have the ability to execute it while allowing it to reference the necessary directory. When I copy and paste the application, it tries to find its necessary files on the desktop rather than in the original directory.
Currently, all my files (including the .exe file) for this program are in the directory C:\Users\my_name\PycharmProjects\PROGRAM_DIRECTORY\build\exe.win32-3.4. I would like to take the file PROGRAM.exe, move it to my desktop (for more accessible execution) while still permitting it to reference all of the necessary files in the C:\...\exe.win32-3.4 directory. Is this possible?
Copying the .exe file from the directory and pasting it to the desktop will create a shortcut that has a default reference directory of its new location (the desktop), and this cannot be changed. A way around this is:
-Right click on the desktop
-Select "New > Shortcut"
-Browse for the .exe file or copy the directory into the field and add \PROGRAM.exe after it
-Name the shortcut
This shortcut will direct the execution to the parent file which remains in its necessary directory (C:\...\exe.win32-3.4) rather than trying to reference the desktop as the directory.
Python/ Tkinter/ cx_Freeze: Creating standalone .exe application outside directory