Loading ...
Sorry, an error occurred while loading the content.

Re: [BATCH WORLD] spaces in for loop

Expand Messages
  • Michael Burek
    I think just putting quote around the %1 argument: %1
    Message 1 of 2 , Aug 31 3:19 PM
    • 0 Attachment
      I think just putting quote around the %1 argument: "%1"

      abc5432110023 wrote:
      >
      >
      > I have a small script which searches for files & then based on
      > filename moves them to another directory
      >
      > for /f "delims=" %%a in ('dir abc* /a:-d /b') do call :abc %%a "
      >
      > :abc
      > set var=%~1
      > if /i %var:~0,3%==abc move %1 "abc"
      >
      > This works fine except for files which have spaces in filename.Then it
      > does not move it at all.
      >
      > Any suggestions
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.