forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Copy all files in a directory

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
nemisis010
Newbie


Joined: 29 May 2002
Posts: 17
Location: Australia

PostPosted: Fri Jun 25, 2004 3:42 am    Post subject: Copy all files in a directory Reply with quote

This is probably a simple query but how the hell do you copy all files in a directory to another directory. It seems pretty simple but i've tried everything i can think of.

Can anyone help please.

_________________
------------------------------------


Boo
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri Jun 25, 2004 5:11 am    Post subject: Reply with quote

Should be something like this:

Code:
LIST CREATE,1
LIST FILELIST,1,C:\My Documents\*.*
IF @greater(@count(1),0)
  LIST SEEK,1,0
  REPEAT
    FILE COPY,@item(1),D:\Backup Files\@name(@item(1)).@ext(@item(1))
    %X = @next(1)
  UNTIL @null(@item(1))@not(@ok())
END
LIST CLEAR,1
LIST CLOSE,1

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
nemisis010
Newbie


Joined: 29 May 2002
Posts: 17
Location: Australia

PostPosted: Fri Jun 25, 2004 7:04 am    Post subject: Fantastic - works Reply with quote

Thanks Garrett, that works great. Wasn't sure that lists would take of the problem.

Thanks again. Very Happy

_________________
------------------------------------


Boo
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Fri Jun 25, 2004 8:22 am    Post subject: Reply with quote

Note that the script which Garrett provided you does not copy the files that are stored in subdirectories.
If you want to have those copied too, I suggest you use the vdsflist.dll (part of the vdsdll3) and let it do a search for *.*, and then use that list to copy the files, since the vdsflist does search in subdirectories.

Just a thought Wink

Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group