Archive: How do I rename the files in a folder with a certain file extension?


How do I rename the files in a folder with a certain file extension?
Hello,

I'm a newbie at this and have to figure something out very quickly, and I'm not sure what the best approach is. I need an installer that will read the contents of my install folder and some of the subfolders (not necessarily recursively) and rename all the files with a .php file extension to remove the extension. How would I do this? I'm not sure if I need any plugins to do this, but I'm trying to get my entire script to be inside one .nsi file, so if i could do it without includes (so far for my projects i've been copying functions into my one file) or plugins, that's best.

thanks


http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.5.12

loop:
FindFirst $0 $1 $INSTDIR\*.php
StrCmp $1 "" done
StrCpy $2 $1 -4
Rename "$INSTDIR\$1" "$INSTDIR\$2"
FindClose $0
Goto loop
done: