views:

40

answers:

2

i have files named..

82011.nsf
63113.nsf
55555.nsf

i must rename each file to single.nsf (for example ren 82011.nsf to single.nsf)

then use a program to act on that file (single.nsf)

then rename the next file (63113.nsf to single.nsf) then use a program to act on that file (single.nsf) etc

I want a batch file to do the nename, pause (so i can run the other program), then do the next rename until all nsf files are done.

how?

A: 

This should work:

for /f %%fname IN (‘dir /b *.nsf’) do call myprog %%a

[src]

aularon
Thank you so much for your helP..
curtb
You cannot use `%%fname` there. Also you shouldn't use `for /f` over the output of `dir` unless it's absolutely necessary. While it may have worked for this case you get yourself in minor pain with file names that contain spaces or Unicode characters that don't have a representation in the OEM codepage (unless you're using a TrueType font for the console; but that isn't the default, so always expect things to break).
Joey
+1  A: 
for %i in (*.nsf) do ( 
  rename %i single.nsf 
  do_the_job 
  pause 
) 
Eugene Mayevski 'EldoS Corp
curtb