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 1045489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:59:35+00:00 2026-05-16T15:59:35+00:00

Trying to use the path to the current script, and the path contains spaces

  • 0

Trying to use the path to the current script, and the path contains spaces in it. I can’t seem to get it to work though:

C:\Test Directory>dir
 Volume in drive C has no label.
 Volume Serial Number is 7486-CEE6

 Directory of C:\Test Directory

08/31/2010  07:28 PM    <DIR>          .
08/31/2010  07:28 PM    <DIR>          ..
08/31/2010  07:28 PM                20 echoit.cmd
08/31/2010  07:28 PM                94 test.cmd
               2 File(s)            114 bytes
               2 Dir(s)  344,141,197,312 bytes free

C:\Test Directory>type echoit.cmd
@echo off
echo %*

C:\Test Directory>type test.cmd
@echo off

for /f "tokens=*" %%a in ('%~dp0\echoit.cmd Hello World') do (
    echo %%a
)

C:\Test Directory>test
'C:\Test' is not recognized as an internal or external command,
operable program or batch file.

C:\Test Directory>
  • 1 1 Answer
  • 1 View
  • 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-05-16T15:59:36+00:00Added an answer on May 16, 2026 at 3:59 pm

    Change test.cmd to the following:

       @echo off
    
       for /f "tokens=*" %%a in ('"%~dp0\echoit.cmd" Hello World') do (
        echo %%a
       )
    

    You need to set the entire command, minus arguments, in quotes. The Windows command prompt treats a collection of words as a single command when the entire collection is quoted, that is why you must exclude the Hello World arguments. If you were to include that in the quotes, Windows would treat that as part of the command not as arguments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my XML file I am trying to use a path to a file;
I am trying to use rspec on my rails application I run spec path/to/spec/spec.rb
I'm trying to change directory in a called bash script. For this I tried
I am trying to iterate through a directory and output if the current item
I'm trying to use this Ubuntu Upstart script to set up Play to run
I am trying to get some information from our database and then use it
I'm trying to test the following helper method in rails: def current_has_class_link(text, path, class_name=selected)
As documented here: http://www.jblotus.com/2011/05/24/keeping-your-handlebars-js-templates-organized/ I am trying to use this function: ( function getTemplateAjax(path,
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use gem tire to search in my application. I have tables

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.