Showing results for September 2004 - Page 3 of 4 - Scripting Blog [archived]

Sep 16, 2004
0
0

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

ScriptingGuy1
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 ...

Scripting Guy!scripting techniquesVBScript
Sep 15, 2004
0
0

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

ScriptingGuy1
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’...

Scripting Guy!scripting techniquesVBScript
Sep 14, 2004
0
0

Why Doesn't My Ping Script Run on Windows 2000 Computers?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have a script that pings a computer before it tries to connect to it. The script works fine on Windows XP, but doesn’t work at all on my Windows 2000 computers. Do you have any idea why?-- AK Hey, AK. As a matter of fact, we do have an idea why. Here’s a simplified version of your script, which pings the computer with the...

Scripting Guy!VBScriptnetworking
Sep 13, 2004
0
0

Why Doesn't My LIKE Query Work on Windows 2000?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I’m trying to use a LIKE query in my WMI scripts. The query works fine on Windows XP computers, but I can’t get it work on Windows 2000 computers. Do you know what I’m doing wrong?-- GS Hey, GS. Actually you’re not doing anything wrong. You’re using a script similar to this, which uses the LIKE operator to search for ...

Scripting Guy!scripting techniquesVBScript
Sep 10, 2004
0
0

How Can I Tell Which Account a Service is Running Under?

ScriptingGuy1
ScriptingGuy1

We have services that run under a particular user account. Each time we change the password for that user account, we need to change the password for any services that run under that account as well. But how can we tell which account a service is running under?-- SA Hey, SA. By and large WMI is a pretty transparent technology. To manage services, ...

Scripting Guy!scripting techniquesVBScript