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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic folder generation at run time

Status
Not open for further replies.

newtechy

Programmer
Sep 23, 2002
22
0
0
US
Can a windows folder be generated dynamically during run time of a DTS Package?? If so, can someone provide sample Active X VB script code to do it?? Help is greatly appreciated...
 
--This will create a folder (if it is not already exist) with today's date as suffix in the format c:\MyFolder_yyyy_mm_dd.

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

Function Main()

Dim oFSO,sFolder
Set oFSO = CreateObject("Scripting.FileSystemObject")

Sfolder = "c:\MyFolder" & year(now()) & "_" & month(now()) & "_" & day(now())
'msgbox SFolder
If NOT (oFSO.FolderExists(DTSGlobalVariables("ExcelFilePath").Value & sFolder)) Then
oFSO.CreateFolder(DTSGlobalVariables("ExcelFilePath").Value & sFolder)
End If

Main = DTSTaskExecResult_Success
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top