Skip to main content

CMD :: Command Prompt: The Basics & a Few Scripts

First of all, I realize there are other articles about this kind of stuff


But I bring up some other stuff that they didn't.



--------------------------------------------------------------------



CMD



CMD is short for commander.

It is great for a lot of things and it's also very clean.







-----------------------------------------------------------------------------------------------

Lets learn how to make the computer shut down everytime it's booted, shall we?

-----------------------------------------------------------------------------------------------







First open CMD,



Next open notepad.



If you write "start shutdown -r" in CMD and press enter, your computer will restart. Also if you write the same in "run".

(Change -r to -s to shutdown computer, or write -l to logg off.)



If you write

---------------------------------------

@echo off



cls

start shutdown -r



cls

goto :a

---------------------------------------

in notepad and save it as something.bat (bat is important) and then open it, your computer will restart in the same way.



So, lets get into autostart. Put that bat file in autostart (autostart can be found in start menu) and each time your

computer is booted it will start that file and your computer will restart.

If you write the next script your computer will try to shutdown several times at once. it will freak for about half a minute

and then turn off.





Lets get a better understanding how scripts works. The above script shuts down your computer, but a bat file normaly opens

CMD and does whatever you told it to do.





@echo off - This is where you put commands that shouldn't be shown as text. For example cls. You don't want that to be text,

it's a command.



cls - This one is pretty good, it clears the text in the CMD screen



CMD - This command gives you a new CMD session.



start - this triggers stuff, in this case it's shutdown.



color - changes the colour in the cmd window, I recommend writing "color 0a", which is a green color thats really cool

on a black window.



title - write "title something" to change title.



goto :a - This one is really, really, really, really cool. It's used for making loops and some more advanced stuff that I

wont go into. Lets say you write

--------------------------------------

@echo off

:a

cls

start shutdown -r



cls

goto :a

--------------------------------------



The goto :a tells you to go to :a higher up in the script. so it starts the script again, then it does the goto :a command

again and the script reloads. Basicaly a loop. You can change the "a" to whatever you want, for example "error". This is

only to make it easier for you to read your script.



The : infront of "a" must stay where it is.

Bad example:

goto: a



Good example:

goto :a



--------------------------------------



dir - This shows you the files in the directory you are in.



dir /s - This shows you all the files on your computer.



echo - write "echo something" and it will be as a text in cmd.



echo. This is a linebrake.



cd - Write cd followed up with a location, to go there in cmd. For example "cd c:\windows".



cd .. - This goes back one step in the directory. For example if your in c:\windows and write "cd .." you go back to c:\.



So now you know the basics, which we'll use to make you computer do stuff. In cmd you can write "help" to get a list of most

commands.



Moving away from learning commands now.







-----------------------------------------------------------------------------------------------

Lets make a spamm script.

-----------------------------------------------------------------------------------------------







-----------------------------------------------

@echo off

cls

:a

start notepad.exe

goto :a



-----------------------------------------------

this script will continue to open notepad until you close cmd. Not recommended to run this on a slow computer.

As we said before, "start" triggers things, this script triggers notepad and then the loop (goto :a) is triggered.







-----------------------------------------------------------------------------------------------

Lets just mess around.

-----------------------------------------------------------------------------------------------







-----------------------------------------------

@echo off

cls

:a

taskkill /im explorer.exe /f

goto :a

-----------------------------------------------



This will close the bar where start menu and tasks are shown, for example if you open internet you will see it at the bottom

of the screen on the explorer bar.

Closing this will leave people with little things to do.



Hope you liked the article. If you think I missed something please contact me.

Comments

Popular posts from this blog

SEO Optimizing A Website For Improved Value

SEO or search engine optimization is something that every web owner and creator should be aware of. Even if a website owner hires an expert to carry out the online marketing, understanding the very basics and how it really can improve a websites performance and popularity is important. Simply put, optimizing a website is important and is built around keywords that are valuable to a website and to the products or services it is trying to provide. By focusing on main keywords or key phrases for a business, and expanding on them over time, can improve the amount of visitors a website receives, in turn increasing profits or simply improving its popularity if it is an information website. SEO is valuable, and means a way of making a site appear at a higher ranking in search engines such as Google, Yahoo, AOL etc. Using this important type of online marketing can reap great benefits. It takes time to learn and time to complete, and is a constant job to keep a website performing well above co...

PsyberOmni: Unlocking the Potential of Digital Excellence

Are you ready to take your digital presence to the next level? PsyberOmni is not just a digital platform; it’s a movement designed to empower individuals and organizations to thrive in the ever-evolving digital world. With expertly crafted tutorials, engaging blog posts, and a community-oriented approach, PsyberOmni is your go-to source for all things digital. Whether you are an entrepreneur, a student, or simply someone eager to learn, PsyberOmni has something for you. In this blog post, we'll dive deep into what PsyberOmni offers, why it's a game-changer for your digital growth, and how you can leverage the tools and content they provide to enhance your skills and expand your digital capabilities. Let’s explore everything you need to know about PsyberOmni! Why PsyberOmni? - Empowering the Digital Landscape In today's fast-paced world, staying updated with digital skills is crucial. PsyberOmni recognizes this need and offers a platform that brings together educationa...

Email On Deck: A disposable email address that works

Today, Team Inforpioneer brings an interesting Email service for our reader which will definitely help our readers to improve their internet security and will benefit in some other ways.  Here is a short description of this service.  EmailOnDeck.com is the premier site for all things relating to temporary, disposable and throwaway email addresses. We want to help you avoid SPAM, protect your online privacy, and stop you from having to give away your personal email address to every company and person on the internet who insists on you giving it to them. We work hard and will continue to work hard to give you a disposable email address that works with any site or app. We hope to help give you back the control of deciding who you want to give your personal info to. Temporary emails are perfect for any transaction where you want to improve your online privacy. Use them when you buy or sell Bitcoins or trade cryptocurrency, at exchanges, or locally. They can be used for QA tes...