Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 10th May 2006, 08:19   #1
o_owd
Senior Member
 
o_owd's Avatar
 
Join Date: Feb 2003
Location: TGM, Romania
Posts: 175
Send a message via ICQ to o_owd Send a message via Yahoo to o_owd
deleting files. only part of the name known

hello,

as the subject sais, i must delete some files.
but i don't know the full name of the files only a part that does not modify. i must delete the older versions.

for example : i have the file some_file_123.txt
ok. i need to delete all files that have the name some_file_XXXXXX.txt where XXXXXX can be any caracter, letters, numbers, punctuation.

can this be done ? because i have no idea how.

thanks in advance,
OJi.
o_owd is offline   Reply With Quote
Old 10th May 2006, 09:07   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
code:

outfile 'test.exe'

section -
Setoutpath $EXEDIR
FindFirst $R0 $R1 "some_file_*.*"
messagebox mb_ok "$R1"
delete "$EXEDIR\$R1"
_loop:
strcmp $R1 '' _end
FindNext $R0 $R1
messagebox mb_ok "$R1"
delete "$EXEDIR\$R1"
goto _loop
_end:
FindClose $R0
sectionend


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 10th May 2006, 09:07   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,338
If you don't know the number of characters:
code:
Delete $INSTDIR\some_file_*.txt
If you do:
code:
Delete $INSTDIR\some_file_??????.txt

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 10th May 2006, 09:22   #4
o_owd
Senior Member
 
o_owd's Avatar
 
Join Date: Feb 2003
Location: TGM, Romania
Posts: 175
Send a message via ICQ to o_owd Send a message via Yahoo to o_owd
did not knew that.

many thanks.
o_owd is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

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