Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

How to create an executable file in command prompt (CMD) like a geek

In this article we are going to discuss how to create an executable file in command prompt, that is, how to create a program (script) that runs in CMD. To be able to do this, you will need to have some knowledge of command prompting, so you should know a few commands in this area.

If you don’t know, no problem; you can use the HELP command to help you with the CMD functions. Then, it will be up to you to continue your research to learn more. Let’s go 😉 !

Before we go any further, I hope you know what the command prompt is. For those who don’t know the command prompt, is the Windows command line interpreter (not a game console or anything like that). It’s used to execute commands. The console is a piece of software, or rather a way of using the operating system by means of commands called console codes. This term is very familiar to users of Linux systems.

executable file

Well, by default the text is white and there is no transparency but you can customise it. That’s right! This means that you can do everything under the command prompt and even more than you would do with the GUI. But that’s not what we’re going to talk about today, I’ll tell you about that in another article. Let’s move on to what we are interested in here.

As software, here we will use the Windows Notepad, but you can use a text editor that you want like sublime text or vscode. So the first thing to do is to launch your Notepad, then save it in a place you want (and with a name of your choice) but with the extension .cmd.

Look at the location you have chosen, you will see a nice executable file, you can even try by running it

.But in most cases, you will get a message like this:

If you find such a message, it is simply because your script has no command yet. So to correct it you just have to type commands in the file and save it. I use the HELP command that I mentioned above. If all goes well, when you run the little script it will start and close suddenly unless you used a different command than mine.

Well, CMD scripts are read by the computer as text files (line by line), that is to say, that the computer reads line by line your script. It tries to execute the tasks it understands and then continues if there is no more task to complete it closes the script.

If you want your script to stay open, use a command that either asks for information input or launches another program and then the script will be closed automatically only after closing the program it launched. Try with the DISKPART command to launch Diskpart, a partition manager (storage media in general) provided by Windows. Here are the captures of my two screens.

Then, if you execute this script it will show the message “You are watching the course code of my script” because the command echo help to display the message. And the command diskpart helps to run the small program “diskpart”

This is just a small script but you can add commands and even a complete program with the same principle. Thanks for reading this article, especially feel free to put any problems or recommendations in the comments. 👍👋

15 Responses

  1. lucky spins says:

    I believe everything published was actually very logical.
    But, what about this? what if you added a little content?
    I am not suggesting your content isn’t solid, however suppose
    you added a post title to maybe grab a person’s attention? I mean How to create an executable
    file in command prompt (CMD) like a geek – Tgeniusclub is
    kinda plain. You ought to peek at Yahoo’s front
    page and see how they create news titles to grab people
    to click. You might add a related video or a picture or two to get readers excited about everything’ve got to say.
    In my opinion, it could bring your posts a little livelier.

  2. 1xbet says:

    Hi there every one, here every one is sharing these knowledge,
    thus it’s pleasant to read this weblog, and I used to visit this weblog every day.

  3. I visited many web pages but the audio feature for audio songs current at this
    web page is really excellent.

    Here is my web page; เครดิตฟรี W88

  4. Betting Apps says:

    Way cool! Some very valid points! I appreciate you penning this write-up plus the rest of the website is very good.

    Also visit my homepage – Betting Apps

  5. Online Slots says:

    I’m amazed, I must say. Seldom do I encounter a
    blog that’s equally educative and amusing, and without a doubt, you’ve hit the
    nail on the head. The issue is something which
    not enough folks are speaking intelligently about.
    I am very happy I stumbled across this during my
    search for something concerning this.

    My blog: Online Slots

  6. Free Spins says:

    You are so awesome! I don’t think I have read something like that before.
    So great to discover another person with some original
    thoughts on this subject matter. Really..
    many thanks for starting this up. This site is one thing
    that’s needed on the web, someone with some originality!

    Feel free to visit my web blog :: Free Spins

  7. Asking questions are genuinely good thing if you are not understanding something totally, but this article offers fastidious understanding
    yet.

    My web blog; Online Football Betting

  8. 22bet says:

    I was curious if you ever thought of changing the page
    layout of your website? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of
    text for only having one or two images. Maybe you could space it
    out better?

    Feel free to visit my web blog; 22bet

  9. Just desire to say your article is as astonishing. The clearness on your submit
    is just excellent and i can think you’re knowledgeable on this
    subject. Fine together with your permission let me
    to grab your RSS feed to keep up to date with approaching
    post. Thank you a million and please carry on the gratifying work.

    Also visit my web page Indian Online Lottery

  10. 三五笑话 says:

    不知道说啥,开心快乐每一天吧!

  11. pure win says:

    Thank you for the auspicious writeup. It in fact was
    a amusement account it. Look advanced to far added agreeable from you!
    However, how could we communicate?

    My web-site – pure win

  12. I am not sure the place you are getting your
    information, however good topic. I needs to spend some
    time finding out much more or working out more.
    Thanks for excellent info I used to be in search of this info
    for my mission.

    my site :: Online Blackjack

  13. bigbaazi says:

    My brother suggested I might like this website. He was totally right.
    This post actually made my day. You cann’t imagine
    simply how much time I had spent for this info! Thanks!

    My web blog bigbaazi

  14. bettilt says:

    I’m really enjoying the theme/design of your blog. Do you ever run into any browser
    compatibility issues? A small number of my blog visitors have complained about
    my website not operating correctly in Explorer but looks great in Chrome.
    Do you have any solutions to help fix this problem?

    my web blog :: bettilt

Leave a Reply

Your email address will not be published. Required fields are marked *