Passing Argument to vbs

Asus / -
February 16, 2009 at 04:58:10
Specs: XP, P4 & 1GB
>msg.vbs echo wsh.echo wsh.arguments(0)

set sharepath=%~dp0
set sharepath=%sharepath:~0,-1%
net share test="%sharepath%" 
if %errorlevel%==0 (
wscript msg.vbs "'OK, Share Success' & vbNewLine & '%sharepath% shared as \\compname\test'"
) else (
wscript msg.vbs "Fail to share %ERRORLEVEL%"

basically i want to achieve the following echo command in vbs, by passing the message as single argument from batch file.
wsh.echo "OK, Share Success" & vbNewLine & "c:\test shared as \\compname\test"
how do i pass an argument containing double quote character into vbs. how to escape the special character, i try the caret ^, doesnt work.

or is there something like %* in vbs? arguments(*)?

See More: Passing Argument to vbs

Report •

February 16, 2009 at 05:55:52
There's nothing like %* from Command Scripts, nor do I know of a method to escape double quotes.

Report •
Related Solutions

Ask Question