| View previous topic :: View next topic |
| Author |
Message |
nelson
Joined: 25 Jan 2008 Posts: 4
|
Posted: Fri Jan 25, 2008 1:38 pm Post subject: VBScript issue |
|
|
I need to set up a script that looks in a directory for a certain set of files, anything that starts with BACKLOG.
I tried using the example for the MP3's but that script also gave me the same error below as my script.
What could i be doing wrong?
Error: #29117, invalid parameter count or type mismatch.
'--- BEGIN OF BackLogFileChecker.VBS ---
Option Explicit
Const retvalUnknown = 1
' ///////////////////////////////////////////////////////////////////////////////
Function CheckBackLogFiles( strDirectory )
Dim numBackLogFiles, objFso, objFolder
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFso.GetFolder("x:\")
numBackLogFiles = CountBackLogFiles( objFolder )
If( numBackLogFiles > 0 ) Then
SYSEXPLANATION = numBackLogFiles & " BackLog files detected"
SYSDATA = numBackLogFiles
CheckBackLogFiles = False
Else
SYSEXPLANATION = "No BackLog files detected"
SYSDATA = 0
CheckBackLogFiles = True
End If
End Function
' ///////////////////////////////////////////////////////////////////////////////
Function CountBackLogFiles( objFolder )
Dim objSubFolders, objSubFolder
Dim objFiles, objFile
Dim iFileNum
iFileNum = 0
CountBackLogFiles = 0
Set objFiles = objFolder.Files
If objFiles.Count <> 0 Then
For Each objFile In objFiles
If( InStr( UCase( objFile.Name ), "Backlog" ) <> 0 ) Then
iFileNum = iFileNum + 1
End If
Next
End If
Set objSubFolders = objFolder.SubFolders
If objSubFolders.Count <> 0 Then
For Each objSubFolder In objSubFolders
iFileNum = iFileNum + CountBackLogFiles( objSubFolder )
Next
End If
CountBackLogFiles = iFileNum
End Function
'--- END OF BackLogFileChecker.VBS --- |
|
| Back to top |
|
 |
nelson
Joined: 25 Jan 2008 Posts: 4
|
Posted: Mon Jan 28, 2008 4:48 pm Post subject: vbscript update |
|
|
| ok, I got the script to at least work in activeexperts, but its not working in function since its saying success even though i have back log files in that directory. |
|
| Back to top |
|
 |
nelson
Joined: 25 Jan 2008 Posts: 4
|
Posted: Wed Feb 06, 2008 7:14 pm Post subject: does anyone even check these forums to help? |
|
|
| does anyone even check these forums to help? |
|
| Back to top |
|
 |
checkered
Joined: 06 Sep 2007 Posts: 5
|
Posted: Wed Feb 06, 2008 7:31 pm Post subject: |
|
|
| not really as far as I've seen :/ I've had a couple questions I asked several months ago still not answered unfortunately. |
|
| Back to top |
|
 |
nelson
Joined: 25 Jan 2008 Posts: 4
|
Posted: Wed Feb 06, 2008 7:40 pm Post subject: amazing |
|
|
| to think i even pay for support...not anymore |
|
| Back to top |
|
 |
|