Computing.Net > Forums > Programming > Passing Argument to vbs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Passing Argument to vbs

Reply to Message Icon

Name: reno
Date: February 16, 2009 at 04:58:10 Pacific
OS: XP
CPU/Ram: P4 & 1GB
Product: Asus / -
Subcategory: Batch
Comment:

>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(*)?



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: February 16, 2009 at 05:55:52 Pacific
Reply:

There's nothing like %* from Command Scripts, nor do I know of a method to escape double quotes.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Passing Argument to vbs

Converting javascript to VB or VBSCRIPT www.computing.net/answers/programming/converting-javascript-to-vb-or-vbscript/18787.html

vb send dos commands to text window www.computing.net/answers/programming/vb-send-dos-commands-to-text-window/14358.html

Passing argument for Java method. www.computing.net/answers/programming/passing-argument-for-java-method/10374.html