CompTIA A+ Core 2 (220-1202), Domain 4, Objective 4.8 focuses on the basics of scripting, and the first thing a technician must recognize is a script's file type. The file extension tells you which interpreter runs the code, which operating system it belongs to, and often what the script is likely doing. On the exam you will be shown extensions such as .bat, .ps1, .vbs, .sh, .js, and .py and expected to match each one to its language, its runtime environment, and its typical platform. On the job, that same skill keeps you from double-clicking something dangerous or from trying to run a Linux script on a Windows box.
In this article you'll learn what each of the six exam-listed script types is, the interpreter or shell that executes it, the platform where you'll normally encounter it, and how the extensions compare side by side. Along the way you'll see a short, correct example of each so the syntax feels familiar rather than foreign.
Why the Extension Matters
A script is just a plain-text file containing commands. What turns that text into action is an interpreter: a program that reads the file line by line and executes it, unlike a compiled program that is converted to a binary ahead of time. The extension is the operating system's shorthand for "use this interpreter." Double-clicking a .ps1 in Windows can be handed to PowerShell, a .py to the Python launcher, and a .sh to a Unix shell. Because the extension controls what runs, it is also the first clue a technician uses to judge whether a file is safe and appropriate for the machine in front of them.