Reading Journal Week 10 Scripting - echadbourne/ChadbourneSYS-140 GitHub Wiki

Scripting Overview

Summary:

  • There does not seem to be a section about scripting in the textbook, so I just looked up some information. The internet says that scripting is “primarily used to automate tasks for websites and web applications while using an existing program.” (Bootcamps). This website also says “All scripting is a form of programming, but not all programming is scripting.”
  • I also found later in the chapter that scripting is also used for files of commands used to automate tasks.

My Response:

  • I don’t know if I got the right definition here, but to me it seems that scripting is essentially programming. In the context of Windows and Command Prompts, which is what we are reading about in this chapter, I would imagine that scripting refers to what is going on in the background when you run a command in the command prompt.

Command Prompt Overview

Summary:

  • You can access the command prompt in a few different ways, including typing “cmd” or “command” into the search function of a Windows computer. From there you can type commands into the command prompt to troubleshoot. To exit you can close the window or use the “exit” command.

My Response:

  • We have been using the command prompt all semester so this is not new to me at all. I did not know you could use the “exit” command, but that’s about it.

Command Prompt Basics

Summary:

  • This section goes over understanding and using a command prompt. First, each hard drive gets a different letter when the computer starts up, with the first being C: and others being anywhere from A: to Z:. You can type commands into the command prompt to tell the computer to do something, and it is important to understand that files in a computer are organized into folders/directories, with the overall directory being the root, and you can do different things in different directories. You can use the “tree” command to view the tree hierarchy of a directory.

My Response:

  • It was nice to have all of this explained in a straightforward manner. I understood the basics of how a command prompt works, but having directories and root directories explained to me in this way has aided in my overall understanding of how to use a command prompt.

Moving Around from a Command Prompt

Summary:

  • The easiest way to change directories is to use the “change directories” command, cd. You can follow the cd command with the directory you want to move to, and if you want to back out you type cd. . to go back one level. You put a backslash between the top directory and subdirectories, but not between the cd and the first directory, like so: cd Test1\Sub2.

My Response:

  • I think we have used the cd command in class before, but it was interesting to learn how you can use it to navigate between directories on the computer, both forwards and back. This seems like it would be a really useful, really basic command to know.

The MD and RD Commands

Summary:

  • The md command is used to make directories, and the rd command is used to remove directories. With both commands you can use the full directory path to make or remove a directory, like so: md F:\classes\cts1133 (you don’t always have to include the F:) but with md you can just use the name of the new directory, and it will be created in whatever directory you are currently in.

My Response:

  • Seems like a useful set of commands to know, because it would be the easiest way to make a directory for a new program. I didn’t specifically know of these commands before, but I think they have been mentioned in class before.

The DEL and TYPE Commands

Summary:

  • The del command can be used to delete a file, but not a directory. To use it, you type the command followed by the full filename, like so: homework1.docx. You will also want to be in the same directory as the file, or you can use the file’s full directory path. The type command allows txt or bat files to be viewed in the command prompt You can also use the | more prompt to view a longer file one screen at a time.

My Response:

  • These commands are useful for the basic purpose of deleting files, and as the textbook mentions, viewing a “readme.txt” file, all straight from the command prompt, for ease of access for someone trying to troubleshoot a computer.

Copying Files

Summary:

  • The copy command is used to copy files, and requires the command, the source of the file (including the filename, if the file is in the current directory only the filename is needed) and the destination (if the new file is going in the directory you are currently in, this is not needed). Other functions include xcopy, which is for files and directories, and robocopy, which is for a directory, all its contents and subdirectories, and attributes.

My Response:

  • This command seems to be another one of those really useful commands you will want to know because you can use it in so many different situations. It is also nice to know the other commands, for the same reason as copy, in addition to helping with backing things up.

The Attrib Command

Summary:

  • The attrib command alters the attributes of a file or directory (it can add, remove, or show these attributes). Attributes include read only, which protects a file from accidental change or deletion, archive indicates files that have changed since last backup, system designates the file a system files and makes it so this file will not show up in directory listings, and hidden hides said file or directory. Usage example: attrib +r +h Cheryl.txt this command will make the Cheryl.txt file hidden and read-only.

My Response:

  • I can see how this command would be super useful for a variety of reasons, the main one coming to mind being for an administrator who is setting up a device for use by an employee or student and who is safeguarding certain directories from the user so they are on the computer but not able to be damaged.

Why Learn Commands?

Summary:

  • Most Windows problems can be solved by working from a command line; this includes things that Windows has not fixed yet, or are just by default able to be fixed from a command line. In addition, scripts can be written (a set of commands in a file for automation purposes) and saved in a .cmd file to help run things from a command line.

My Response:

  • I never knew you could write scripts with Windows commands by just saving them in a file together; that is really neat! I can see how that would be a really useful way to automate something you do a lot, or if a computer has a common problem you could save the solution in a script file for future reference.

Powershell

Summary:

  • PowerShell is a tool built in on Windows computers designed to help with the execution of commands and scripts for troubleshooting and computer management purposes. According to the textbook, “every command that you can type from a command window (and a lot more) can be executed from within PowerShell.” (PowerShell section, Chapter 15).

My Response:

  • This seems like it would have been good to know earlier, but it is nice to know that a tool like this exists just for the people fixing and managing computers. I would love to see this program and understand how it works and how it could help with a problem the computer might be experiencing.