Jump to content

Recommended Posts

Posted

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.


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

echo %%d

)

FOR %%d in (
" I think these are needed
xxx yyy zzz (
" I think these are needed

) DO (

echo %%d

)

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

echo %%d

   

I am not sure but this may work

Posted

@my2001

I'm not sure to understand what you want but if I understand this code can solve the problem

FOR %%D IN ("XXX" "YYY" "ZZZ") DO ECHO %%~D

Hoping this help

:)

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...