Do you have a scripting-related question or problem? You can send your question or problem to winscriptsol@win2000mag.com.
I found a .vbs logon script by Grant Ardern (http://cwashington.netreach.net/script_repository/view_scripts.asp?index=416&scripttype=vbscript) that contained the code that Listing 1 shows. I know that this code is using the Net Start command to start the specified service, but what's the purpose of Chr(34)?
VBScript's Chr function returns the character associated with the ANSI value you specify in the parentheses. Chr(34) returns a double quote ("). In VBScript, double quotes are special reserved characters that you use to identify the beginning and end of a string. However, you also use double quotes in VBScript code for other purposes, such as enclosing command arguments that have embedded spaces.
In Listing 1, Ardern uses a string that contains two related parts: The command to run, Net Start, followed by the command's argument, Network Associates McShield. Because Net Start's argument contains spaces, you must enclose it in double quotes. Otherwise, the scripting engine will interpret this part of the string as three distinct arguments.. . . .
Justin Hackett March 09, 2004