I am new to JScript so please forgive me if this is obvious to you all and I have made a stupid simple mistake but:<BR>I have a problem in that I receive a text file onto my server in a name format of MyName.DDMMYYYY - yes that is correct no extension. I need to rename this file through the SQL DTS engine to be in the format of MyNameDDMMYYYY.csv<BR><BR>I am using the JScript ActiveX Script Task available within SQL Server but could just as easily use VBScript. The database is held on a separate drive to the wwwroot folder as recommended by Microsoft.<BR>I have searched the Microsoft Knowledge Base and came up with code similar to below.<BR>I cant seem to get any variation of the code to work:<BR><BR>JScript:<BR><BR>&#060;script language="JScript"&#062;<BR> function fnNameGetSetJ()<BR> {<BR> var objShell = new ActiveXObject("Shell.Application");<BR> var objFolder2;<BR> <BR> objFolder2 = objShell.NameSpace("C:\");<BR> if (objFolder2 != null)<BR> {<BR> var objFolderItem;<BR> <BR> objFolderItem = objFolder2.ParseName("AUTOEXEC.BAT");<BR> if (objFolderItem != null)<BR> {<BR> var szReturn;<BR> <BR> szReturn = objFolderItem.Name;<BR> objFolderItem.Name = "TEST.BAT";<BR> }<BR> }<BR> }<BR>&#060;/script&#062;<BR><BR><BR><BR>Below is a script I have used before in a VB exe file that I have just pasted into the VBScript ActiveX Script tool in SQL but it wont run, keeps telling me there is a error but not where that error is. I have used this script in a Visual Basic program so I know this works, can anyone convert for me please.<BR><BR><BR>&#039;************************* ****<BR>&#039;Visual Basic ActiveX SCript<BR>&#039;*****************************<BR>< BR>Function Main()<BR><BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>strF ileName = "C:InetpubwwwrootWebFolderImportJRMFP."&FormatDate (strDate, "mmddyyyy")<BR>strCSVFileName = "C:InetpubwwwrootWebFolderImportJRMFP"&FormatDate( strDate, "mmddyyyy")&".CSV"<BR><BR>If fso.FileExists(strFileName) Then<BR>Name strFileName As strCSVFileName<BR>End If<BR><BR>Main = DTSTaskExecResult_Success<BR><BR>End Function<BR><BR><BR>Thanks in advance for any help you may be able to give. Again please dont ridicule me I have wasted so much time on this trying to get it to work I cant see the wood for the trees.<BR> <BR>