September 08 2010 07:52:52
Navigation
· Home
· Online Store
· Course Outlines (PDF Files)
· Sample Videos
· Contact Info
· Web Links
· Articles (Sample Code)

Other Videos
· WordPress (CMS)
· Joomla (CMS)
· Sharepoint

Other
· FAQ
· Search
Contribute to This Site
· Submit Link
· Get Benefitted Sites
No Competition
One of our so-called competitors offers under 6 hours of video training for a whopping $219 (choke, gasp, spew - you could hire a private tutor for that price). Did I mention that they ship their training on VHS tapes (remember those?). Check out our 'Course Outlines' link above. We offer a 2-days of training (15 hours) for $54 (2 CDs at $29 each). You watch our videos from a CD/ROM on your computer. We also include real-world lab/assignments in each course.
Articles: FSO / Files in a Folder
FSO / Files in a Folder
'==========================================================================
' NAME: FSOFilesInFolder.vbs
' AUTHOR: Neal Walters 
' DATE  : 3/26/2005
' http://VBScript-Training.com 
'==========================================================================
Option Explicit 

WScript.Echo ShowFolderList("c:\Documents and Settings\nwalters\My Documents\Camtasia Studio\VBScript-Training2")
WScript.Echo "------------------"
'WScript.Echo ShowFolderList("c:\")  'Gets permission denied on some folder? 
'WScript.Echo "------------------"

Function ShowFolderList(folderspec)
   Dim fso, f, f1, fc, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFolder(folderspec)
   
   
   Set fc = f.Files 
   s = " There are " & fc.Count & " files in this directory." & VbCrLf & VbCrlf 
   For Each f1 In fc
      s = s & "filename=" & f1.name & " Created=" & f1.DateCreated &  " Last Modified:" & f1.DateLastModified 
      s = s & " size=" & f1.size & " path=" & f1.path 
      s = s & VbCrLf 
   Next
   ShowFolderList = s
End Function


Make copy of most recent file in directory
I needed to FTP a specific file on a nightly basis. My backup utility put the date/time into the filename itself, for example: STUDENTS_FullDBBackup_200904010320.BAK So rather than scripting the FTP backup, I wanted to always download a file such as STUDENTS_FullDBBackup.BAK. This VBScript copies the most recent .BAK file and drops the date/time out of the filename. It could be modified for other purposes. It include a handy function called GetMostRecentFile.
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Order Now - View Products


Default Shipping:
Phone: 214-403-6006
Our Sites
Software Training
XML-Online-Training.com
Biztalk-Training.com
SharePoint-Training.com
DotNet-AddOns-Training.com
CMSTrainingVideos.com

Language
LanguageLovers.com
Render time: 0.04 seconds 432,182 unique visits