Reputation:
I have a keyboard with 6 keys I can assign pretty much anything to, including opening apps.
I want to be able to open Spotify with one of these keys, but I have to have to link a .exe to to the key - no other file type will work.
I have Spotify downloaded from the Windows Store, so it's stuck under the WindowsApp folder in Program Files, which means I can't access it directly. Even if I create a shortcut and put it on the desktop, it's not an .exe, it a .lnk.
I'm wondering if there's a way to create a .exe file that will run the Spotify shortcut that I have on my desktop, or any app at all.
I know it sounds redundant - creating a .exe to run a .exe - but I can't access the WindowsApp folder to directly link it to my keyboard. I know a batch file would work, but I can't link a .bat to my keyboard, only .exe.
I don't have experience creating executables, so I don't even know where to start and I haven't been able to find anything online.
Upvotes: 2
Views: 23822
Reputation: 11732
If you wish to try this yourself, you will need to:
While this might sound complicated for somebody without experience, in this case is not that hard.
Here is how you can do it using the very simple PureBasic compiler
:
```
; // make this a console program
OpenConsole()
; // specify path to another executable
pathToExecutable$ = "C:\Program Files\Sublime Text 3\sublime_text.exe"
; // use RunProgram to launch another executable
x = RunProgram(pathToExecutable$)
```
File
menu at the top, then click on Save As...
, you will be prompted for a name for your source code file.Desktop
then, enter a name for the file, for example proxy
. (this will create a proxy.pb
file)proxy.exe
executableCompiler
menu, then click on Create Executable...
proxy
and then click on Save
(this will create proxy.exe
on your Desktop)You can move your new created executable anywhere, it's portable.
Good luck!
Upvotes: 4
Reputation: 177
This is Stack Overflow where you can do it yourself so here is how.
Make a batch file to start the program of your choice. (Code would look like the following)
@start "" "C:\users\JimithyJones\Desktop\Spotify.exe" && exit
Convert it to an EXE with one of the previous programs. WARNING! Sometimes they are detected as malicious files because batch files have the capability to do harm to your computor.
Assign the new EXE to your hotkeys.
Upvotes: -1