External drive check with WMI

June 2, 2016 — Leave a comment

external drive attached == yes || no? Simple enough you might say but I hadn’t tried it before. Growing with confidence from practicing Perl, Python and Ruby in my spare time, I decided I should be able to use WMI, my go to tool when administrating Windows systems.

Here’s what I came up with…

@echo off
echo "Please enter a valid hostname or type exit to quit"
set /p host="Enter Hostname: "
if %host% == exit goto escape
wmic /node:"%host%" logicaldisk get description, name
goto main

No Comments

Be the first to start the conversation!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s