DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: Help in ASP Script

  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Help in ASP Script

    Hi,

    I just want to move/copy of source file
    From:
    \\ctor-vfs1\public\Outsourcing\Clients (Data Team)\Jihn\Miscellaneous\REPORTS\
    To:
    \\ctor-vfs1\public\Outsourcing\Clients (Data Team)\Jihn\

    But getting error message of 'Path not found' and 'run time error' Please help and advise.

    Thanks.
    Code:
    'My script is:
    '**********************************************************************
    '  Visual Basic ActiveX Script
    '************************************************************************
    
    Function Main()
    	DIM sdate
    	Dim sFileName
    	Dim sNewFileName
    	Dim sSourcePath
    	Dim sDestinationPath
    	Dim sDestinationPath1
    	Dim current_year
    	Dim currentmonth
    	Dim current_day
    	Dim current_month_num
    
    	sFileName	 	= "JNJ_Retiree_Address_Change_ Report.XLS"
    	sSourcePath		= "\\ctor-vfs1\public\Outsourcing\Clients (Data Team)\Jihn\Miscellaneous\REPORTS\"
    	sDestinationPath	= "\\ctor-vfs1\public\Outsourcing\Clients (Data Team)\Jihn\"
    
                 
    	'Find Old File Name
    	sNewFileName = Left(sFileName, InStr(sFileName, ".")-1)
    
    	'Add Current Date to File Name
    	current_date = replace(date(),"/","")
    	sNewFileName = sNewFileName & "_" & current_date
    
    	'Add File Extension to New File Name
    	sNewFileName = sNewFileName & Right(sFileName, Len(sFileName)-InStr(sFileName, ".") +1) 
    
    	' Get current year
    	current_year =   DatePart("yyyy", date())
    
    	' Get current month
    	current_month =   DatePart("m", date())
    	current_month_num =   DatePart("m", date())
    	
    	' Get current day
    	current_day =   DatePart("d", date())
    
    	sDestinationPath = sDestinationPath & current_year & "\" & current_month & "\"
    
    	Set fso = CreateObject ("Scripting.FileSystemObject")
    	     If fso.FileExists (sSourcePath  & sFileName) Then
    	            fso.CopyFile sSourcePath & sFileName, sDestinationPath  & sNewFileName
    	  '          fso.DeleteFile sSourcePath & sFileName
    	      End if
    
    Set oFSO = Nothing
    	Set oFolder = Nothing
    	Set oFileCollection = Nothing
    	Set oFile = Nothing
    
    	Main = DTSTaskExecResult_Success
    
    End Function
    Last edited by Hack; 04-14-2009 at 12:21 PM. Reason: Added Code Tags

Similar Threads

  1. Replies: 2
    Last Post: 08-23-2005, 02:19 PM
  2. ASP script process too early
    By Beth in forum ASP.NET
    Replies: 2
    Last Post: 09-25-2002, 08:26 AM
  3. ASP SCRIPT
    By 01011011 in forum ASP.NET
    Replies: 0
    Last Post: 12-23-2001, 04:55 PM
  4. ASP Script Help
    By JohnS in forum ASP.NET
    Replies: 0
    Last Post: 11-27-2001, 06:35 PM
  5. Replies: 0
    Last Post: 10-17-2001, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center