Getting a list of logical and physical drives from the command line

Standard

It’s often useful to know what logical and physical drives are available to Windows, and sometimes this needs to be done from the command line.

Logical drives

Here’s a handy command to return a list of logical drives in Windows.

The Win32_LogicalDisk WMI class represents a data source that resolves to an actual local storage device on a computer system running Windows. While Caption, Description, DriveType, ProviderName, and VolumeName are useful in most cases, more properties are available, and a complete list is available at http://msdn.microsoft.com/en-us/library/windows/desktop/aa394173(v=vs.85).aspx. The output will be formatted as a table, the properties will be the column headings, and they will be placed into alphabetical order.

Caption is the drive letter of the logical disk. The Name property also returns the drive letter.

Description is the type of disk. For example: Local Fixed Disk, CD-ROM Disc, or Removable Disk.

DriveType is returned as an integer that corresponds to the type of disk drive the logical disk represents (and this matches the Description, making DriveType sort of superfluous).

0 = Unknown
1 = No Root Directory
2 = Removable Disk
3 = Local Disk
4 = Network Drive
5 = Compact Disc
6 = RAM Disk

ProviderName is the network path to the logical device.

VolumeName is the volume name of the logical disk.

Physical drives

And here is a command to return a list of physical drives.

The Win32_DiskDrive WMI class represents a physical disk drive as seen by a computer running Windows. Like the Win32_LogicalDisk WMI class, it has lots of properties, as listed at http://msdn.microsoft.com/en-us/library/windows/desktop/aa394132(v=vs.85).aspx.

For simplicity, though, and ease of reading in command window, wmic diskdrive list brief /format:list does the trick, particularly in combination with wmic logicaldisk.

189 total views, no views today

Shutdown or Wake Up a PC on a LAN

Standard

FROM: http://ccm.net/faq/9200-shutdown-or-wake-up-a-pc-on-a-lan


Shutdown or Wake Up a PC on a LAN

In addition to serving as a host, a LAN (or local area network) also gives users a certain amount of control over the PCs that are connected to a network. Included in this is the ability to turn a computer on or off from a remote location.

This article will explain how to use the Shutdown command to turn off a computer remotely as well as how to use the WakeOnLan standard to wake or boot a PC.

This method was tested using a Windows XP Professional computer.

Remotely Shutdown a Computer on a LAN

In order to control a computer remotely, please note that you must be connected to the same local network as the target PC. You must also know the username and password required for login.

The first step is to open TCP port 445 on the target computer. To do this, open your Start menu and then go to Settings > Control Panel > Security Center.

Open Windows Firewall and click the Exceptions tab.

Select the line that reads File Sharing and printers and press OK. If this line is missing, click Add Port and choose TCP port 445 .

Next, head to Start > Settings > Control Panel > System. Select the Remote tab and check the option that reads Allow users to connect remotely to this computer.

It is now time to open the command prompt.

Head to Start/Run or use the keyboard shortcut Windows + R. Next, type cmd and then hit OK. This will open your command prompt.

To obtain the necessary rights to run a shutdown command on the target machine, you must first run the net use command. Use the Windows + R keyboard shortcut and then enter net use \\ip_address_of_target_machine. Enter an administrator username and password for the target computer to connect to the target PC.

Once connected to the target PC, we can run the shutdown command. An example of the command is given below, whereby instructions are given for the target computer to close all active applications and shutdown after 30 seconds of inactivity. Please note that you can substitute any of the variables according to your network or PC specifics:

-s: Shutdown the PC

-f: Force active applications to close without warning

-t xx: Set a countdown in seconds

-m \\xxx.xxx.xxx.xxx: The IP address of the target computer


The GUI is available by typing shutdown -i.

For any additional information about this command, type shutdown /?.

The WakeOnLAN Command

WakeOnLAN, as the name already suggests, is a tool that can boot or wake a computer by sending a Magic Packet to the network adapter of the target computer. It is important to note that not all network cards and BIOS are compatible with, or support, the use of Magic Packet.

In order to use the WakeOnLAN command, you must be connected to the same local area network (LAN) as the target computer. Knowledge of the physical location (MAC) and IP address of the target computer is also required.

Retrieve IP and MAC Address

The first step is to retrieve the IP address and MAC address of the target computer. To do this, go to Start/Run or use the keyboard shortcutWindows + R and type cmd > OK.

The command prompt will open. Now type ipconfig /all:


Copy the IP and physical (MAC) address of the target PC.

Compatibility Checks

It’s now time to check if your network card is compatible with Magic Packets. To do this, right-click on My Computer and click Manage. Next, go to Device Manager/Network Cards and do a right-click on your Network Card. Then click Properties.

Do a search for the following words and verify that all options that relate to them are currently active: Magic Packet, Wake On Magic Packet, Wake On Lan, or Wake. If none of these words appear, you may be required to update the drivers for your Network Card.

To see if your computer is BIOS compatible, enter the BIOS when you start the computer. You can do this by pressing ESC, F2, F5, F12 or DEL (depending on your system).

Once in the BIOS, go Power Options and enable Wake-On-LAN, or any similar option:


Open Port 8900

You can open Port 8900 in the same way as you would Port 445.

Wake On LAN (WOL)

Start by downloading the Symantec WOL tool on the source computer. Launch the tool and then fill in the empty fields using the information gathered above.

Mac Address: MAC address (the target machine)

Internet Address: Local IP address (target machine)

Subnet Mask: 255.255.255.255

Send Options: Local Subnet

Remote Port Number: 8900

Click the button: Wake Me Up

Once the packet has been received, the target computer will boot:

255 total views, no views today

The Ultimate Guide to Windows 10 Keyboard Shortcuts

Standard

The Ultimate Guide to Windows 10 Keyboard Shortcuts

If you want to give the impression that you’ve been using Windows 10 for years, learning a few keyboard shortcuts is the best way to go about it—you can navigate around the interface, get apps in position, trigger events, change settings and more with a couple of taps on your keyboard. Here are the shortcuts we’ve been finding most useful.

Window snapping

The Ultimate Guide to Windows 10 Keyboard Shortcuts1

Window snapping has changed slightly in Windows 10 and so have the shortcuts. App windows can be snapped to either side of the screen, as in Windows 8, but you can also assign them to quadrants and get four windows open on screen simultaneously.

Windows Key+Left — snap active window to the left.

Windows Key+Right — snap active window to the right.

Windows Key+Up — snap the active window to the top.

Windows Key+Down — snap the active window to the bottom.

Bonus: Whenever you snap a window to a side or a quadrant, Windows will automatically suggest you pick one of your open apps to fill the remaining real estate on your desktop.

Virtual desktops

The Ultimate Guide to Windows 10 Keyboard Shortcuts

Official support for virtual desktops is one of the most exciting new additions in Windows 10—unless you’ve been developing a third-party utility to do the same job! It’s kind of like having extra invisible monitors. Each desktop can have its own set of apps but shortcuts and wallpaper are consistent across the board.

Windows Key+Ctrl+D — create a new virtual desktop.

Windows Key+Ctrl+Left — scroll through your desktops to the left.

Windows Key+Ctrl+Right — scroll through your desktops to the right.

Windows Key+Ctrl+F4 — close the current desktop.

Windows Key+Tab — see all your desktops (and open apps!) via the Task View page.

Cortana and settings

The Ultimate Guide to Windows 10 Keyboard Shortcuts

As you’ll know by now, Cortana has arrived on the desktop. If you don’t feel entirely comfortable shouting out “hey Cortana!” across a crowded room, then there are keyboard shortcuts that can help—once Cortana is active, you can choice voice or keyboard input.

Windows Key+Q — open up Cortana ready for voice input.

Windows Key+S — open up Cortana ready for typed input.

Windows Key+I — open up the Windows 10 settings pane.

Windows Key+A — open up Windows 10 notifications (Action Center).

Windows Key+X — open the Start button context menu (the one with easy access to a host of common computer management features—like the Command Prompt below).

Command prompt

The Ultimate Guide to Windows 10 Keyboard Shortcuts

The new Windows 10 command prompt gets new keyboard shortcuts as well. To use them, right-click on the command prompt title bar and choose Properties. On the Options tab, untick Use legacy console and enable Ctrl key shortcuts as well as the two text selection options.

Shift+Left — highlight text to the left of the cursor.

Shift+Right — highlight text to the left of the cursor.

Ctrl+Shift+Left (or Right) highlight blocks of text instead of just characters at a time.

Ctrl+C — copy selected text to the Windows clipboard.

Ctrl+V — paste text from the Windows clipboard into command prompt.

Ctrl+A — select all text after the prompt.

These work in other text-based applications as well, but they’re new to Command Prompt.

Finding your way around

The Ultimate Guide to Windows 10 Keyboard Shortcuts

Besides all the new Windows 10 keyboard shortcuts, there are plenty of old classics that have survived successive versions of the operating system and are still going strong. Here are the combinations you’re going to need to navigate around the interface.

Windows Key+, — temporarily hide apps to briefly show the desktop.

Windows Key+D — minimize apps to go straight to the desktop.

Ctrl+Shift+M restore all minimized windows to full-size (useful after a Win + D)

Windows Key+Home — minimize all windows except the one you’re actively using

Windows Key+L — lock your PC and go to the lock screen.

Windows Key+E — launch File Explorer (aka Windows Explorer).

Alt+Up — go up one level in File Explorer.

Alt+Left — go to the previous folder in File Explorer.

Alt+Right — go to the next folder in File Explorer.

Alt+Tab switch between windows. (Hold down Alt while tapping Tab to pick visually).

Alt+F4 close the current window.

Windows Key+Shift+Left (or Right) move a window to your next monitor.

Windows Key+T — cycle through taskbar items (hit Enter to launch).

Windows Key+Any Number Key — open the app pinned to the taskbar in the numbered position (e.g. Win+2 launches the app in your second taskbar slot)

Going deeper into Windows

The Ultimate Guide to Windows 10 Keyboard Shortcuts

Unlock parts of Windows you never knew existed: Here are the shortcuts you need if you want to go way beyond the surface of the software into settings and options that would otherwise be difficult to find. Don’t click on anything unless you know what you’re doing.

Ctrl+Shift+Esc — open the Windows 10 Task Manager.

Windows Key+R — open the Run dialog box.

Shift+Delete — delete files without sending them to the Recycle Bin.

Alt+Enter — show the properties of the currently selected file.

Windows Key+U — open the Ease of Access Center.

Windows Key+Space — switch input language and keyboard.

Windows Key+Shift+Any Number Key — launch a new instance of the app in the numbered taskbar slot

Windows Key+Ctrl+Shift+Any Number Key same, but launch the app with admin powers enabled

Pictures, video and display

The Ultimate Guide to Windows 10 Keyboard Shortcuts

As you would expect, Windows 10 is a very visual OS and there are keyboard shortcuts to help you capture screenshots, record on-screen activity and zoom in and out. Note that to use theGame DVR recorder app you’re going to need a decent graphics setup installed.

Windows Key+PrtScr — take a screenshot saved to your Pictures folder.

Windows Key+G — open the Game DVR recorder (if supported by your graphics card).

Windows Key+Alt+G — start recording activity in the current window.

Windows Key+Alt+R — stop recording in the Game DVR.

Windows Key+P — switch between display modes (with a secondary display connected).

Windows Key+plus — zoom in using the Magnifier utility.

Windows Key+minus — zoom out using the Magnifier utility.

Find even more obscure keyboard shorts at this link.

 

706 total views, no views today

HTML Snippets Powered By : XYZScripts.com