Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


excluding directory

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1422
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> excluding directory
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 excluding directory - 10/1/2004 5:45:53 AM   
  bskelley

 

Posts: 2
Score: 0
Joined: 10/1/2004
From:
Status: offline
I need to copy a folder. Inside the folder there is one folder that I can't copy, don't want/need to copy. The other problem is it's not always named the same thing. It will always have test in it, it just could be c:\move\test, c:\move\testing, c:\move\test1.

Is there a way I can move the rest of the folders in it and tell the script to bypass any folder with the word test in it???

Thank you for any help!

Skel
 
 
Post #: 1
 
 Re: excluding directory - 10/1/2004 11:39:44 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
One way is to do an instr, I have just thrown the instr line together so check the syntax to make sure it is correct.

quote:
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set sf = f.SubFolders
For Each f1 in sf
If instr(lcase(f1.name),"test") = FALSE
'Do the copy
Next


Or use xcopy with an exclude file
quote:
WshShell.Run "cmd /c c:\move d:\Move\ /e /c /y /exclude:c:\excludefile.txt",1,true


The exclude file would contain test and it should exclude any form of test, but I have not tested this.

(in reply to bskelley)
 
 
Post #: 2
 
 Re: excluding directory - 10/4/2004 2:10:11 AM   
  bskelley

 

Posts: 2
Score: 0
Joined: 10/1/2004
From:
Status: offline
Thanks for the info. It's a big help.

Skel

(in reply to bskelley)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> excluding directory Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts