Showing tag results for Scripting Guy!

Sep 21, 2004
Post comments count1
Post likes count0

How Can I Determine if a Computer is a Laptop or a Desktop Machine?

ScriptingGuy1

Hey, Scripting Guy! Is there any way to use WMI to determine whether a computer is a laptop or a desktop machine?-- CB Hey, CB. You bet there is, although if you didn’t know that we have no idea how you’d figure it out on your own. It turns out there’s a goofy little WMI class called Win32_SystemEnclosure, and the ChassisTypes property can tell yo...

Scripting Guy!VBScripthardware
Sep 20, 2004
Post comments count0
Post likes count0

How Can I Tell if a Computer Has a DVD Drive Installed?

ScriptingGuy1

Hey, Scripting Guy! How can I tell if a computer has a DVD drive installed?-- GC Hey, GC. No doubt you’re hoping we’ll say something like, “Why, you just use the Win32_DVD class, of course.” Unfortunately, though, we can’t say that; that’s because there is no Win32_DVD class, or any class devoted to DVD drives. There is, of course, the Win32_CDROM...

Scripting Guy!VBScripthardware
Sep 17, 2004
Post comments count0
Post likes count0

How Do I Bind to a User Account in a Sub-OU?

ScriptingGuy1

Hey, Scripting Guy! How do I bind to a user account when the user is in a sub-OU? Code like this doesn’t work: LDAP://CN=Ken Meyer, OU=NA\Human Resources, DC=fabrikam, dc=com.-- RD Hey, RD. The past few days we’ve done some lengthy answers to questions, so we decided to be a little lazy today (hey, it is Friday!) and take an easy one. In your Acti...

Scripting Guy!VBScriptActive Directory
Sep 16, 2004
Post comments count0
Post likes count0

How Do I Get Rid of Extraneous Spaces in a String?

ScriptingGuy1

I know that I can use the Split command to separate a sentence like this - VBScript is fun! - into an array of individual words. However, what happens if I have a sentence like this: VBScript is fun! I can’t use a blank space as the delimiter because I might have lots of blank spaces. And I can’t use a specific number of blank spaces as the delimi...

Scripting Guy!scripting techniquesVBScript
Sep 15, 2004
Post comments count0
Post likes count0

How Can I Use Both Command-line Arguments and a Default Value?

ScriptingGuy1

Hey, Scripting Guy! I’d like to have a script that accepts computer names as command-line arguments and then runs against each of those computers. However, if you don’t enter any command-line arguments, I’d like it to default to running against the local computer. Can you help me out here?-- TS Hey, TS. Sure, we can help you out here. Let’s say yo...

Scripting Guy!scripting techniquesVBScript