1

I'm a little new to scripting and would like help renaming a folder in every users directory. I would like to accomplish the below but it sounds like I would have to use a FOR loop to go through every user profile. Does someone have an example of how to accomplish this or maybe another method?

ren "C:\Users\%userprofile%\AppData\TEST" "C:\Users\%userprofile%\AppData\TEST1"
Adam
  • 13
  • 1
  • 3
  • 2
    Check this answer to a similar question. Good luck! http://stackoverflow.com/questions/19379828/loop-through-directory-names-using-a-batch-file – roost9in Nov 17 '16 at 22:23

1 Answers1

0

Use FOR /D to match only directories

 FOR /D %%G IN (C:\users\*) DO (
    ren "%%G\AppData\TEST" "TEST1"
    )
Richard
  • 1,121
  • 1
  • 9
  • 15