Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 23rd March 2012, 08:23   #1
launchpadtt
Junior Member
 
Join Date: May 2008
Posts: 5
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
launchpadtt is offline   Reply With Quote
Old 23rd March 2012, 10:29   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
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:
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
file, rename

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump