Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine File Size

Status
Not open for further replies.

ohmbru2

Technical User
Jul 24, 2001
51
US
I'm trying to determine the file size. Can anyone push me in the right direction? This is from a DTS Package.

'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************

Option Explicit

Function Main()
Dim objFSO
Dim objFolder
Dim iDate
Dim iFile

Main = DTSTaskExecResult_Failure

iDate = "0807"
DTSGlobalVariables("iFileName").Value = ""
iFile = "\\tamlrpcapp2\volume1$\AMLOPSRPT\MOBE\PendNI\GA" & iDate & "P.dat"

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(iFile) Then
Set objFolder = objFSO.GetFile(iFile)
Else
Exit Function
End If

If objFSO.FileSize(iFile) > 0 Then
DTSGlobalVariables("iFileName").Value = iFile
Else
Main = DTSTaskExecResult_Success
End If

Main = DTSTaskExecResult_Success
End Function


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top