Discussion Locked

How get a "for /R" cmd run on NT 4 Srv ?

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to run a command on a Windows NT 4.0 SP6a server.

I wrote the following batch file to test on my XP PC first:-

for /R "C:\testdir\" %%1 IN (*.bm?) DO rename %%1 *.tif

This was top rename .bmp files to .tif (don't ask..!).

Works fine on my XP PC but when I tried the same on my Windows NT 4.0 Server SP6a the command ran but it had added an extra slash (/) after the directory name - just after the last ". There was no error message but it didn't do anything.

Please help.

P.S. - Also useful if anyone has a way to run a batch file in NT every 60 seconds....cheers.

6 replies

by joseph moore

First off, I take it you can't just use the RENAME command for some reason? I know that RENAME does not travel to sub-directories, so if you have sub-directories under c:\testdir that you also need to rename the TXT files, RENAME won't work. You would have to run RENAME statements in each directory. But you could do that in a BAT file like this:

@ECHO OFF
C:
CD \
CD TESTDIR
RENAME *.TXT *.TIF
CD subdir1
RENAME *.TXT *.TIF
etc...

by tomhass

Okay - last couple of answers didn't quite get there - I have found the answer to the batch command ...didn't like dir in quotes on NT.

However, I still don't know how to schedule a batch file to run every 60 seconds (yes - I know about AT command but can't see how to do this without adding many many AT jobs !!!).

So...anyone up on AT ?

Cheers

Tim

This discussion is closed to new replies.