Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:55:03+00:00 2026-06-07T14:55:03+00:00

I am trying to pass a snipit of code as a command line argument

  • 0

I am trying to pass a snipit of code as a command line argument to a program running on WinXP.
I have not been able to pass the entire code snipit as one argument.
It gets split by SPACE and QUOTE characters (as expected).
Quoting the whole thing and escaping QUOTE chars with QUOTE, SLASH or CARAT also fails…

Const TheCode = "main(""Literal String Argument"", 123, true)"
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.Run """c:\Folder with space\ArgTest.vbs"" """ & TheCode & """"

I run the following vbs script to echo the arguments back to test what is recieved.

ArgTest.vbs:

Dim ArgumentIndex
For ArgumentIndex = 0 to Wscript.Arguments.Count - 1
    Call Msgbox(Wscript.Arguments(ArgumentIndex), vbOKOnly+vbInformation, "Argument " & ArgumentIndex)
Next

Edit:
It turns out that it is the VBS Echo script that stips out the QUOTES. Use QUOTE to escape.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:55:05+00:00Added an answer on June 7, 2026 at 2:55 pm

    There is no standard in Windows for escaping quotes. It is entirely up to the discretion of the developer of the app how quotes should be escaped. If you don’t have documentation for your app that explains how to do it, then you will have to discover it on your own (assuming the app even supports escaped quotes)

    It sounds like you tried back slash:

    Const TheCode = "main(\""Literal String Argument\"", 123, true)"
    

    You also say you tried caret:

    Const TheCode = "main(^""Literal String Argument^"", 123, true)"
    

    Have you tried doubling up the quotes?

    Const TheCode = "main(""""Literal String Argument"""", 123, true)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pass a command parameter with my command. I have commands in
Trying to pass the values but not making progress. Scenario : Have a public
trying to pass in data from a file as a cmd line argument in
Trying to pass something to something else. Says undefined. Not sure how or why.
Trying to pass a string argument to a function, which will then be used
im trying to pass new query to FlexiGrid using this code: $('#fgAllPatients').flexReload({ query: 'blah=qweqweqwe'
Iam trying to pass dynamic argument values i.e username from request using spring ioc.But
I'm trying to pass an int between two classes using a bundle. I have
I am trying to pass not only the dropdownlist ID using this, but I'm
Im trying to pass variable to the order... [code].order(['SUM((prices.price * ?) + profiles.shippingCost)', params[:prod_id]]).all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.