troubleshooting Question

Create a .cmd or .exe file

Avatar of WeThotUWasAToad
WeThotUWasAToad asked on
ProgrammingMicrosoft DevelopmentMicrosoft DOSWindows OSVisual Basic Classic
7 Comments1 Solution421 ViewsLast Modified:

This is a follow-up to another thread located here:

Create an executable file to open a non-executable file

In that thread, expert Joe Winograd provided a solution which involves creating an AutoHotkey (ahk) "Run" command (which I know how to do) then compiling the resulting .ahk file to create an .exe file. That was a great solution and I'm glad to now know how to do that. However, since closing the previous thread, I've realized that that solution is not practical for the specific purpose* that prompted my question.

As a result, I'm back to my original question which is:

How do you directly create an executable file (.exe or .cmd) to open a non-executable file (.xlsm, .txt, .ahk, etc)?

In the previous thread, expert tuvi suggested putting the following in a .cmd file:

start C:\Users\UserName\FolderName\FileName.xlsm

Open in new window

Unfortunately, while I know how to place a command in the cmd/prompt/DOS window (not sure what it's called), I do not know how to create a .cmd or .exe file. I tried simply pasting the above line in a Notepad window then saving it, first with a .cmd extension and then with an .exe extension but neither of those worked.

It seems like something I should know how to do but that's why I'm happy all of you great experts are available to answer questions. :)


*The main reason I'm looking for a different solution is that the 2-3 scripts (.ahk files) involved are frequently updated and  having changes made. Consequently, the process of creating then running a new matching .exe file each time an .ahk file is changed, takes more time than simply manually opening the .ahk file in the first place — which is what I'm attempting to avoid if possible.

A ____________________ [A LOT OF SPACE] ____________________ LOT

"ALOT" is not a word — it never has been a word and it never will be a word.
"A LOT" is two words. Remember it as though there's [A LOT OF SPACE] between them.
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros