Wednesday, 7 August 2013

VB script - why CMD window get the parameter name and not the value of parameter

VB script - why CMD window get the parameter name and not the value of
parameter

I need to run the following command on CMD window under C:\Program
Files\CONNECTION
connect "user_vip"
so write short VB script that perform this action
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
USERC = """user_vip"""
Wscript.Echo USERC
oShell.run "cmd /k CD C:\Program Files\CONNECTION & connect USERC " ,1 ,
true
After I run the VB script I see the following from CMD window
connect USERC
and not as I expected to see:
connect "user_vip"
why parameter in oShell.run not get the real value - "user_vip" ?? from
USERC ?
remark - Wscript.Echo USERC actually print the value - "user_vip" as I
expected

No comments:

Post a Comment