Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Compare # of files.

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Compare # of files.
  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 >>
 Compare # of files. - 11/6/2007 7:57:57 AM   
  doctortt

 

Posts: 73
Score: 0
Joined: 6/15/2007
Status: offline
Hi, I have a script that copies a folder to a network location. What can I do to make sure the number of files/folders that are copied is the same as the original location? Thanks
 
 
Post #: 1
 
 RE: Compare # of files. - 11/6/2007 8:07:06 AM   
  dm_4ever


Posts: 2724
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
The SubFolder and Files properties of the filesystemobject have a Count property...


Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objFolder : Set objFolder = objFSO.GetFolder("C:\temp")

WScript.Echo objFolder.SubFolders.Count
WScript.Echo objFolder.Files.Count

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to doctortt)
 
 
Post #: 2
 
 RE: Compare # of files. - 11/6/2007 8:58:02 AM   
  doctortt

 

Posts: 73
Score: 0
Joined: 6/15/2007
Status: offline
Thank you for the assistance.
So, I have to do the count function on both the orginial and target locations then compare the files and subfolders count?


(in reply to doctortt)
 
 
Post #: 3
 
 RE: Compare # of files. - 11/6/2007 9:35:12 AM   
  dm_4ever


Posts: 2724
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Yep.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to doctortt)
 
 
Post #: 4
 
 
 
  

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 >> Compare # of files. 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