What Is A Command Prompt
What Is A Command Prompt
Use shortcuts: Pressing Windows + X and then selecting Command Prompt from the
menu is a handy shortcut.
Run as Administrator: If you need elevated privileges, right-click on “Command Prompt”
and select “Run as administrator.”
Pin to Taskbar: For quick access, right-click on the Command Prompt icon in the Start
menu and select “Pin to taskbar.”
Use PowerShell: Windows 11 might show PowerShell instead of Command Prompt. You
can use PowerShell similarly or search specifically for Command Prompt.
Keyboard navigation: After pressing Windows + X, you can use the arrow keys to
navigate to the Command Prompt option.
The ping command tests network connectivity between two devices by sending ICMP echo
requests. For example, computer A tests if it has connectivity to computer B by sending some
packets back and forth.
The ping command is still one of my favorite tools for testing basic network connectivity. It’s
fast and very easy to use. In addition, I use it for the following:
ping 192.168.100.1
2. ipconfig (get network adapter details)
The ipconfig command is used to display a computers TCP/IP configuration. You can display the
IP info for a single or all network cards installed on a computer.
netstat -a
netstat -a -n
The cls command will clear the command prompt console. This is useful when the screen has a
lot of information on it and you want a blank screen.
At the windows command prompt type cls and press enter to clear the screen.
5. diskpart
Diskpart allows you to manage disks, partitions, and volumes on your local computer. You can
delete, create, format, extend and shrink volumes.
diskpart
list disk
The schtasks commands lets you add, remove, change and view scheduled tasks on the local
computer.
Schtasks
With C++ Code Scheduling algorithms
FCFS
#include<iostream>
using namespace std;
int main()
{
int n,bt[20],wt[20],tat[20],avwt=0,avtat=0,i,j;
cout<<"Enter total number of processes(maximum 20):";
cin>>n;
cout<<"\nEnter Process Burst Time\n";
for(i=0;i<n;i++)
{
cout<<"P["<<i+1<<"]:";
cin>>bt[i];
}
wt[0]=0; //waiting time for first process is 0
//calculating waiting time
for(i=1;i<n;i++)
{
wt[i]=0;
for(j=0;j<i;j++)
wt[i]+=bt[j];
}
In Windows, we use dir call to list all directories, and in most of the
other Operating Systems “ls” is used. Below is a simple C++
implementation to list directories of folders irrespective of OS.
C++
C
int main()
#ifdef _WIN32
system("dir");
#else
system("ls");
#endif
return 0;
FIFO
#include <iostream>
using namespace std;
int main()
{
int incomingStream[] = {7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1};
int pageFaults = 0;
int frames = 3;
int m, n, s, pages;
pages = sizeof(incomingStream)/sizeof(incomingStream[0]);