|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Jul 2004
Posts: 6
|
how to copy files from one dir to another with file extention.
Hi Iam writing a Installer script what it does is ……it will copy a * .p12 files from temp to config dir
Temp and config are two different dir’s , both will have not only *.p12 ,but also another files. Temp should only copy the *.p12 files from temp to config dir and remove old *p12 files from config dir It will work only if we know the file name. ………Without knowing the filename how to copy only specific type of file’s from one dir to another with help of file extension. Here am writing script, which is, not work bur I want to explain you in detail. outfile "C:\Importcert1.exe" section Import StrCpy $R4 "" loop: IfFileExists "C:\Program Files\VistaWiz\OpenVPN\temp\*.p12" config no_config no_config: Strcmp $R4 "counter" endall MessageBox MB_ICONEXCLAMATION|MB_OK \ 'Could not find p12 Files In temp Dir .\ $\n "Without it you cannot run " ${APPNAMEANDVERSION}". \ $\n$\n Please Extract E-Mail Attachmet Into temp Dir Then Click Importcert Link.' goto endForGood doDel: StrCpy $R4 "counter" ; KillProcDLL::KillProc "openvpn-gui.exe" delete "C:\Program Files\VistaWiz\OpenVPN\config\*.p12" config: KillProcDLL::KillProc "openvpn-gui.exe" StrCmp $R4 "" doDel CopyFiles /SILENT "C:\Program Files\VistaWiz\OpenVPN\temp\*.p12" "C:\Program Files\VistaWiz\OpenVPN\config\*.p12" delete "C:\Program Files\VistaWiz\OpenVPN\temp\*.p12" goto loop endall: SetOutPath "C:\Program Files\VistaWiz\OpenVPN\bin\" Exec "openvpn-gui.exe" endForGood: sectionend Please help p me I really appreciate |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
code: To delete all .p12 files in the temp dir, you should use FindFirst, FindNext etc: code: Then call the function like so: code: This will delete all p12 files in that directory. -Stu |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2004
Posts: 6
|
Thank you very very much !
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|