Windows PowerShell vs Command Prompt
What is batch file ?
A batch file is a text file that contains a sequence of commands for a computer operating
system. It's called a batch file because it batches (bundles or packages) into a single file a set
of commands that would otherwise have to be presented to the system interactively from a
keyboard one at a time.
How to create a batch file
1. Just type anything in notepad
2. Next save the notepad with .bat don’t put any common name as [Link] etc put
name as [Link]
Executing Batch Files
Following are the steps to execute a batch file −
Step 1 − Open the command prompt ([Link]) as run as admin
Step 2- Next go the location of batch by cd or cd ..
Step 3- then dir --- type the name of the batch .It will show the line of .bat file.
Difference Between PowerShell and CMD
1. Windows Command Prompt (also known as the command line, [Link]
or simply cmd) is a command shell based on the MS-DOS operating system
from the 1980s that enables a user to interact directly with the operating
system.
Windows PowerShell is a command shell and scripting language designed for
system administration tasks. It was built on top of the .NET framework, which is a
platform for software programming developed by Microsoft in 2002.
2. cmd is a very old tool that was never intended for remote system
administration. Extending its functionality requires additional utilities, such
as Microsoft Sysinternals PsExec.
PowerShell, on the other hand, provides many cmdlets to simplify system
administration tasks. It supports the automation of a wide range of tasks, such as
Active Directory administration, user and permissions management, and extracting
data about security configurations. Moreover, PowerShell now supports Linux.
3. Both cmd and PowerShell are powerful command line tools used to
automate system administration tasks by writing a script/batch file.
However, cmd has limited administration capabilities as compared to
PowerShell, which, on the other hand, is a more advanced and
modern shell implementation with additional features and
enhancements. PowerShell is specially designed for system
administrators to control and automate the administration of
windows systems.
4. the Command Prompt, which can only pipe streams of text, the
output generated from a cmdlet is more than just stream of text; they
pipe objects between cmdlets which allows them to share more
complex data between cmdlets.