Advertisement

10.10.2008 at 08:30AM PDT, ID: 23804477
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

ActiveX script to check for a file in a directory, log the filename and then rename it

Asked by SurreyWebDesigner in VB Script, MS SQL DTS, ActiveX

Tags: , ,

Hi Experts,

I currently have the attached script working as a .vbs file on my desktop, but I didn't write it and I don't have any experience in this kind of thing, which is causing me a problem as I need to modify it to do what I need.

Basically, I need to include an ActiveX script in a dts package that I'm working on that will check a folder to make sure there is a file in there (which will always start with the same string but will end with a random one). There should only ever be one file in there. Once it's checked that it is there it needs to somehow make a note of the original filename. Ideally this would be stored in a database table as I'll need to reference it later. Then it needs to rename the file to 'feed.in'

Can anyone help with modifying this script to do what I need, or possibly writing a new one that will do the job??

Please note that this is just a script I found elsewhere on EE so the fact that it renames all of the files in a directory doesn't relate to what I actually need it to do, it's just that this was the closest I could get to what I wanted!

Many thanks in advance.
SWDStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
Const folder = "C:\documents and settings\swd\my documents\testfolder"
Const logfile = "logfile.log"
 
' ===
 
If folder = "" OR logfile = "" Then
	WScript.Quit
End If
 
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
 
Set objfolder = fso.GetFolder(folder)
 
If fso.FileExists(folder & "\" & logfile) Then
	fso.DeleteFile(folder & "\" & logfile)
End If
Set objlog = fso.CreateTextFile(folder & "\" & logfile, true)
 
Call LoopFolder(objfolder)
 
 
Sub LoopFolder(folderobj)
	
	
	Set objfiles = folderobj.files
	Set objsubfolders = folderobj.subfolders
	
	for each subfolder in objsubfolders
		Call LoopFolder(subfolder)
	next
	
	i = 1
	
	for each file in objfiles
		if not file.Name = logfile Then
		objlog.WriteLine("[" & Now() & "] Renaming File " & file.Name & " to " & folderobj.Path & "\" & folderobj.Name & i & "." & fso.GetExtensionName(file.Name))
		file.Move folderobj.Path & "\" & folderobj.Name & i & "." & fso.GetExtensionName(file.Name)
		End If
i = i+1
	next
	
End Sub
[+][-]10.10.2008 at 03:50PM PDT, ID: 22691327

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, MS SQL DTS, ActiveX
Tags: Microsoft, SQL Server, 2000
Sign Up Now!
Solution Provided By: brettdj
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.12.2008 at 03:05AM PDT, ID: 22696872

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 05:41AM PDT, ID: 22697233

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 07:09AM PDT, ID: 22697441

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 03:52AM PDT, ID: 22701364

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 04:19AM PDT, ID: 22701479

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 04:32AM PDT, ID: 22701528

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 04:43AM PDT, ID: 22701571

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 05:00AM PDT, ID: 22701637

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 06:35AM PDT, ID: 22702227

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 08:14AM PDT, ID: 22703125

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10.13.2008 at 08:33AM PDT, ID: 22703301

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 09:05AM PDT, ID: 22703565

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 09:20AM PDT, ID: 22703704

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 09:34AM PDT, ID: 22703808

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.13.2008 at 03:15PM PDT, ID: 22707047

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 01:18AM PDT, ID: 22709410

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 05:14AM PDT, ID: 22710534

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 08:58AM PDT, ID: 22712587

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 09:06AM PDT, ID: 22712677

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 09:19AM PDT, ID: 22712827

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 10:04AM PDT, ID: 22713337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 10:32AM PDT, ID: 22713637

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.17.2008 at 02:19AM PDT, ID: 22738845

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.17.2008 at 02:36AM PDT, ID: 22738934

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.18.2008 at 09:17AM PDT, ID: 22748620

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 - Hierarchy / EE_QW_2_20070628