0

There's some advanced file moving that needs to be done with the Windows command prompt; Is it possible to do it with wildcards?

Using regular expressions in UNIX, I could do something like this to find all files that begin with "s" and then do something else with them (echo).

ls s(.*) ; echo Found file \1 , needs to be moved to C:\unicorns\(\1)

I want to do something like that in Windows command prompt:

:: find all files that begin with "s" and then do something else with them (echo)
dir s(*) ; echo Found file \1
Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
rlb.usa
  • 14,942
  • 16
  • 80
  • 128
  • Related to Q http://stackoverflow.com/questions/31143039/batch-script-to-move-specific-subfolders-to-new-parent-folder-based-on-current-p/31144592#31144592 – rlb.usa Jun 30 '15 at 17:29

1 Answers1

1

Do something like this:

for %%f in (*) do (echo %%f)

This will echo a list of files found in current directory. Find more description here

Community
  • 1
  • 1
norekhov
  • 3,915
  • 25
  • 45