0

I have this 'win32 shell scipt' (?):

FOR %%filename IN (*.txt) DO (
...
)

I would like to replace the set (*.txt) with a set of strings defined as variable at the beginning of the script. Could someone please point me to the appropriate documentation of 'win32 shell scipt' or even better provide some 'code'?

Adriano Repetti
  • 65,416
  • 20
  • 137
  • 208
cs0815
  • 16,751
  • 45
  • 136
  • 299

1 Answers1

1

Not clear the requirements, but, as requested, some code

@echo off
  setlocal enableextensions disabledelayedexpansion

  :: the normal strings
  set "var1=one"
  set "var2=this is a test"
  set "var3=two"

  :: a set of files
  set "var4=*.cmd"

  for %%a in ("%var1%" "%var2%" "%var3%" "%var4%") do echo %%a, %%~a

And, of course, you should see for /?

MC ND
  • 69,615
  • 8
  • 84
  • 126