Executing one Winbatch program with another using RunWait

Posted on 2006-05-22
Last Modified: 2008-02-26
I am using a Winbatch script to execute another Winbatch script using the RunWait() statement. When I pass the other Winbatch program a parameter with an embedded blank it doesn't work. The parameter is a path which allows embedded blanks in the level of Windows I am using, but not I guess in the parameter variable. RunWait takes its parameters in the form %LogPath% where LogPath is assigned a string value of the path. How do I get RunWait to take the path as a single unit instead of multiple parameters when there are embedded blanks in the path contained in the variable LogPath?
Question by:BraveLad
    LVL 48

    Expert Comment

    Did you try "%LogPath%" ?

    Author Comment

    Yes. It didn't work and honestly I did not expect it to since, that would make the parameter a constant and not a variable I thought. I guess I was right.
    LVL 3

    Assisted Solution

    Enclose the value in Quotes, or tick marks.

    Author Comment

    What is the syntax in Winbatch to do this?

    Author Comment

    If I assign a string value enclosed in quotes in Winbatch, it only puts in what is inside the quotes in the variable. How do I get the quotes in the string in Winbatch?
    LVL 3

    Accepted Solution

    Then delimited it with tick marks instead like '"hello world"' would result in the string being set to "hello world".

    Author Comment

    Jphillips247, thank you. That worked. It was the lack of literal quotes in the string that caused the difficulty. There is a StrCat() function that also worked as well as your suggestion. This is a technique available in several languages, alternate forms of quotation in the syntax. So if you have single quotes and double quotes as alternates, then to get the other in its literal way included anywhere in the string, just enclose the whole in the alternate quote character to the one you wish to appear literally.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Android App Development

    This course will involve creating widgets, customize list view, grid view, spinners, etc. Creating applications using audio, video, and SQLite database. Ending with publication on Google Play.

    Suggested Solutions

    Title # Comments Views Activity
    countTriple  challenge 8 59
    sum28 challenge 31 82
    zeroMAx challenge 20 66
    Sql how to exclude from a table 3 60
    INTRODUCTION We all know how to code. But at times you simply want to insert a common code block into your existing code and amend it as per your requirements. This tool not only saves you time but also saves you the pain of typing it all out aga…
    Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now