By the end of this lesson you will be able to
- Copy and move a practice file with `Copy-Item` and `Move-Item`, and explain the overwrite risk.
- List running processes with `Get-Process` or `tasklist` and find a process ID.
- Read the key lines of `ipconfig` and the result of a `ping` test.
- Find help for any command with `Get-Help` or `/?`.
- Explain what running as administrator means and why you should avoid it unless a task truly needs it.
When a Windows laptop will not connect, runs slowly or refuses to open a file, support staff often start in a terminal. In a few short commands they can see which programs are running, which address the laptop has on the network, and whether the router answers. You can do the same, and nearly all of it is read-only. This lesson also shows how to ask Windows how any command works, so you are never stuck memorising. Anything that changes files stays inside your practice folder.
Copying and moving files
You made $HOME\practice\notes.txt in the previous lesson. If you did not, create the practice folder and a file called notes.txt first. Copy-Item makes a second copy and leaves the original alone. Move-Item takes the file out of one place and puts it in another, so afterwards only one copy exists. Both need a source and a destination: Copy-Item notes.txt notes-backup.txt copies a file to a new name in the same folder. In Command Prompt the matching words are copy and move.
To try Move-Item, first create a subfolder with New-Item -ItemType Directory -Name archive, then Move-Item notes-backup.txt archive. The file is now inside archive. A move within one disk is simply a relabel, so it is quick.
- Marker 1: Copy: the original stays
- Marker 2: Move: the file leaves this folder
- Marker 3: Only the folder and notes.txt remain
Read this figure as text
A simulated PowerShell window in the practice folder running Copy-Item, New-Item for a folder, Move-Item and Get-ChildItem.
A simulated PowerShell window in C:\Users\Amina\practice. Copy-Item notes.txt notes-backup.txt prints nothing (marker 1). New-Item -ItemType Directory -Name archive prints a small table for the new directory archive. Move-Item notes-backup.txt archive prints nothing (marker 2). Get-ChildItem then lists the folder archive and the file notes.txt, but notes-backup.txt is no longer in this folder because it was moved (marker 3).
What is running? Processes
A Process is a running program. Windows keeps a list, and each entry has a number called the process ID. In PowerShell Get-Process prints the list; Get-Process notepad shows only processes named notepad. In either shell tasklist prints a similar list. You can see the same information in Task Manager (press Ctrl+Shift+Esc), which is the friendlier tool for ending a frozen program, covered in an earlier lesson. Reading the list does not change anything.
- Marker 1: Id is the process ID
- Marker 2: tasklist shows the same number as PID
Read this figure as text
A simulated PowerShell window showing Get-Process notepad with its table and tasklist with a filter for notepad.
A simulated PowerShell window. Get-Process notepad prints a table with the columns Handles, NPM(K), PM(K), WS(K), CPU(s), Id, SI and ProcessName. One row shows 245 handles, 14 NPM, 2800 PM, 14500 WS, 0.31 CPU seconds, process Id 7420, session 1 and the name notepad (marker 1). Next, tasklist with a filter for notepad.exe prints the columns Image Name, PID, Session Name, Session number and Mem Usage; the row shows notepad.exe with PID 7420 and 14,500 K (marker 2). The Id and the PID are the same number.
Is the network working? ipconfig and ping
ipconfig (short for IP configuration) shows how your computer is set up on the network. Look for the adapter that is in use, usually Wireless LAN adapter Wi-Fi or Ethernet adapter Ethernet. The line IPv4 Address is your laptop's address on the local network, and Default Gateway is the address of your router. These ideas are explained fully in the networking path; for now, just read them. ipconfig /all adds more detail, including the physical address of the adapter. That address identifies your device, so do not post it publicly.
- Marker 1: This laptop's address on the home network
- Marker 2: The router's address
Read this figure as text
A simulated Command Prompt running ipconfig and showing the Wi-Fi adapter with IPv4 address, subnet mask and default gateway.
A simulated Command Prompt. ipconfig prints the heading Windows IP Configuration, then the section Wireless LAN adapter Wi-Fi. Lines in it: Connection-specific DNS Suffix is empty; IPv4 Address is 192.168.1.23 (marker 1); Subnet Mask is 255.255.255.0; Default Gateway is 192.168.1.1 (marker 2). The IPv4 address is this laptop on the home network and the default gateway is the router.
ping sends a few tiny test messages to another device and waits for each answer. It shows whether the device is reachable and how many milliseconds (thousandths of a second) the round trip took. On Windows it sends four messages and stops. Try ping 127.0.0.1, which tests your own computer's network software, then ping followed by the Default Gateway from your own ipconfig. Only ping your own router or addresses you are told to use for testing.
- Marker 1: Replies: the device is reachable, 0% loss
- Marker 2: Timeouts: no answer from that address
Read this figure as text
A simulated Command Prompt with a ping to 192.168.1.1 giving four replies and a ping to 192.168.1.99 timing out.
A simulated Command Prompt. ping 192.168.1.1 prints Pinging 192.168.1.1 with 32 bytes of data, then four lines of the form Reply from 192.168.1.1: bytes=32 time=3ms TTL=64 (marker 1), then Ping statistics: Packets sent 4, received 4, lost 0 (0 percent loss), and round trip Minimum 2ms, Maximum 5ms, Average 3ms. A second test, ping 192.168.1.99, which has no device, prints four lines of Request timed out and statistics showing 4 sent, 0 received, 4 lost (100 percent loss) (marker 2).
- Step 1: ipconfigDo I have an IPv4 address and a gateway?
- Step 2: ping the gatewayDoes my router answer?
- Step 3: ping a site namee.g. example.com
- Step 4: Note the first failureTell whoever helps you
Read this figure as text
A flow of four steps: run ipconfig, ping the gateway, ping a website name, and decide what to check next.
Step 1: run ipconfig and check that the adapter has an IPv4 address and a Default Gateway. Step 2: ping the Default Gateway. If it fails, the problem is between the laptop and the router, so check Wi-Fi or the cable. Step 3: if the gateway answers, try ping with a website name such as example.com. If that fails but the gateway worked, the problem is beyond your router or in name lookup. Step 4: note which step failed and use it when asking for help.
Getting help from the command line
You do not have to remember options. In PowerShell, Get-Help Get-ChildItem shows a summary; adding -Examples shows sample uses. In Command Prompt, put /? after a command, as in ping /? or dir /?. The first time you use Get-Help, Windows may say it can only show part of the help and offer to download more with Update-Help. You can ignore that: the basic help works, and Update-Help needs administrator rights. For the full text with pictures, search the command name on learn.microsoft.com.
Get-Help Get-Process -Examples
Get-Help Copy-Itemping /?
dir /?Run as administrator: a power tool, not a habit
A normal terminal window uses your everyday permissions. Windows can also open a window as administrator, with the power to change system settings and files that belong to Windows. Windows asks you to confirm through a User Account Control prompt. This is the Windows version of Linux sudo. Programs run in that window can also do more damage, including by accident.
How do you know if a window is elevated? The title bar of the window normally says Administrator. If you see that and did not need it, close the window and open a normal one. Windows also controls access with permissions on each file and folder. You can see them in File Explorer: right-click a file, choose Properties, then the Security tab. Changing them is rarely needed on a personal laptop, and wrong changes can lock you out of your own files.
Common mistakes
✖ Instead of: Running every command in an Administrator window 'to be safe'.
✔ Do this: Use a normal window. Administrator mode removes protections and is rarely needed.
✖ Instead of: Assuming a timed-out ping proves the internet is broken.
✔ Do this: Some devices do not answer pings. Test the router first, then a website, and note which step fails.
✖ Instead of: Copying a file onto an existing name without checking.
✔ Do this: List the destination first, and preview with -WhatIf.
If something goes wrong
Request timed out.for every ping, including the router.- Check that Wi-Fi is on and connected, or the cable is plugged in, and run ipconfig to confirm you have an IPv4 address. If the address starts with 169.254, the laptop did not get an address from the router; restarting the router and reconnecting is the usual next step.
Ping request could not find host.- The name could not be looked up or was typed wrongly. Check spelling, and try pinging your router's address to separate a local problem from a name problem.
Access is denied.when running a command.- You do not have permission. Check that you are working in your practice folder. Do not escalate to administrator just to make the message go away.
Get-Process : Cannot find a process with the name 'notepad'.- The program is not running. Open it first, then run the command again, or run Get-Process on its own to see what is running.
Key terms
- Process
- A program that is currently running, together with the memory and resources it is using.
- Cmdlet
- A built-in command in PowerShell, named in a Verb-Noun style.
- PowerShell
- A powerful Windows text tool where you type commands to control the computer.
- Administrator
- A user account allowed to change important settings and install software for the whole computer.
- Default gateway
- The device on a network, usually the router, that sends traffic on to other networks.
Practise it for real
Reading is not the same as being able to do it. Complete these on your own computer, then tick only what you have actually done. These ticks are your own honest record: nothing checks them for you.
Copy and move inside the practice folder
In PowerShell go to $HOME\practice. Copy notes.txt to notes-backup.txt, create a folder called archive, and move the backup into it. Use Get-ChildItem and Get-ChildItem archive to prove where each file is. Then run Copy-Item notes.txt archive -WhatIf and read the message.
Look at processes and the network
Open Notepad, then run Get-Process notepad and note its Id. Run tasklist and find the same number. Close Notepad normally. Then run ipconfig, write down your IPv4 Address and Default Gateway, and ping the gateway. Do not share the numbers online.
Challenge: learn a command from its help
Pick a command you have not used, such as Get-Date or hostname. Read its help with Get-Help Get-Date -Examples or hostname /?, predict what it will print, then run it. Write one sentence explaining what it does and whether it changes anything.
Knowledge check
6 questions. You need 80% to pass. Mistakes here are part of learning, and you can retry as often as you like.
Summary
- Copy-Item duplicates; Move-Item relocates. Both can overwrite silently, so check first and use -WhatIf to preview.
- Get-Process and tasklist list running programs and their process IDs without changing anything.
- ipconfig shows your address and your gateway; ping tests whether a device answers.
- Get-Help in PowerShell and /? in Command Prompt explain commands.
- Administrator windows are powerful and risky. Use a normal window unless a trusted source gives a clear reason.
Checklist: can you do these?
Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).
Related lessons
References and further reading
Official sources for details that can change between versions.
- Get-Help (Microsoft.PowerShell.Core) (Microsoft Learn)
- ipconfig command reference (Microsoft Learn)
- ping command reference (Microsoft Learn)
- tasklist command reference (Microsoft Learn)