Question
CSCI 4200 Lab 1 Windows Command Prompt 10 Writing a script file . Let's suppose that you need to re-create the directories TREES, PECAN, and
CSCI 4200 Lab 1 Windows Command Prompt 10
Writing a script file.
Let's suppose that you need to re-create the directories TREES, PECAN, and OAK on a regular basis. You can automate this task by creating a script file. Launch the Notepad program by using the Search box. Type the following into Notepad, and remember to replace your directory with the name of your actual directory:
C:\"your directory"\PLANTS
mkdir TREES mkdir TREES\OAK
mkdir TREES\PECAN cd ..
Save this file as makedirs.bat in your I drive (make sure you Save it as type: All Files (*.*), so it is saved as a .bat file not a .txt file) and exit from Notepad. The .bat file extension represents a batch file, another name for a script. To execute the script, go back to the command prompt console and change directories to where you saved your makedirs.bat file. Then type the name of the batch file:
makedirs
-- this will automatically create the TREES, OAK, and PECAN directories for you! Check it with the tree command.
tree
Windows environment variables.
Windows maintains a collection of data available to all running programs, called the
environment. For example, a program might need to know the special directory set aside for storing application data. This variable is called APPDATA. To find out the value of this variable, use the echo command. Type
echo %appdata%
note that the variable name is not case-sensitive, but must be enclosed in percent signs.
Use the echo command to find out the values of the following environment variables:
PATH |
List of directories that the command processor will search to find a command |
COMSPEC |
The command processor executable file that you are using now. |
HOMEPATH |
The path to your home directory |
PROCESSOR_IDENTIFIER |
Description of the CPU on this computer |
WINDIR |
The directory where the OS is located |
CSCI 4200 Lab 1 Windows Command Prompt 11
Now lets try a few commands to investigate the hidden resources of your system. Use the command
driverquery to get a list of all the drivers installed on your system. Yikes, there are lots of drivers installed!
Useful networking commands.
Use the command
ipconfig /all
to see the computers IP address and other info that would be interesting if you knew what it all meant! Dont worry; well be explaining this later. This command is useful for debugging network problems. Here are some other useful commands to try:
ping cs.uga.edu
the ping command sends a probe message out to the remote computer, to see if it is possible to connect, and if so how long it takes for the response to return. You should find that the response is so quick that it is recorded as less than 1 ms (milliseconds). Now try using the ping command with the address in.pool.ntp.org, a computer located in India. This time the response will be a lot
longer!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started