Jump to content

How to run lines of code in CMD?

CandleJakk

Hey guys, I frequently run 2 -  3 lines of code in cmd. I've made a notepad file so I can just copy the code into cmd every time, but is there a way I can just make a file that runs the code in cmd? I've searched "how to run a program in cmd" but it just came up with people opening programs in cmd (as in, teaching people how to run programs by typing in run [program name]). Any ideas? 

thanks all!

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, KuJoe said:

Renamed the .txt file to .cmd and you can just double click on it.

Oh right nice, thanks man! Much appreciated :)

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, CandleJakk said:

Oh right nice, thanks man! Much appreciated :)

If you run them at start just drop the file into your start up folder. I do this to mount my NAS and use robocopy to back up me files. You might also want to add pause to the end of the file to stop it from closing to see if the commands completed 

 

Spoiler

win + r

shell:startup

ok/enter

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

On 7/24/2016 at 9:51 AM, vorticalbox said:

If you run them at start just drop the file into your start up folder. I do this to mount my NAS and use robocopy to back up me files. You might also want to add pause to the end of the file to stop it from closing to see if the commands completed 

 

  Reveal hidden contents

win + r

shell:startup

ok/enter

 

Alright, thanks for the advice! But I have like 6 unique ones which are all similar but serve diff. purposes (and they can't run simultaneously (?)), but if I ever do need to use one at startup, I'll use this! Thanks for the reply :)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×