Jump to content

[batch] FOR-command with spaces in arguments


Recommended Posts

FOR %%d in (xxx yyy zzz) DO (
 echo %%d
)

That's my basic structure which, of course, works fine. But unfortunately one of my arguments (i.e. xxx, yyy and zzz) contains spaces, e.g. "x xx" and FOR-command recognizes this as two separate argruments then.

Isn't there a possibility except /F switch to tell FOR to that one argument contains spaces? I tried to use quotes like 'xxx' etc. but this didn't help.

I can't take the spaces out of the arguments b/c my arguments represent registry keys which woulnd't be valid any longer w/o the spaces.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...