Advertisement
Advertisement
| 07.25.2008 at 04:04PM PDT, ID: 23597028 |
|
[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.
Your Input Matters 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! |
||
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: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: |
Dim fso As New FileSystemObject
Dim f As Folder, sf As Folder, path As String
Dim file as File, iniFile as File, drpFile as File
Dim currFile as File
Dim inifiles() as string, drpFiles as string
'Initialize path.
'path = Environ("windir")
path = Environ("P:\Programs\") 'THe root of the Subfolders to be searched is P:\Programs\
'Check the path exists
if not fso.FolderExists(path)
MsgBox "Folder Does Not Exist" & path, vbOKOnly
end if
'Get a reference to the Folder object.
Set f = fso.GetFolder(path)
If fld.SubFolders.Count > 0 Then
'Iterate through subfolders.
For Each sf In f.SubFolders
MsgBox "Sub Folder" & sf.Name
' or Debug.Print sf.Name
'Iterate through files in each subfolder
'Do I need to do this to get access to files in a subfolder?
' First Change all .ini file to .live
For each iniFile in sf
If Not iniFile.FileExists("*.ini") Then
' If No ini file exists in Subfolder Loop to next Folder
'loop to next sub directory
else
' Get the file name
Dim strIniFileName as string
strIniFileName = iniFile.name
' check this file extention
' there might be more than one ini file
' How do i check this?
' Use .GetExtensionName to check if its .ini perhaps
if iniFile.GetExtensionName = ".ini"
' Or is this "ini" (no .)?
dim nameNoExt as string
dim newEXT as string
Dim LiveFile as string
liveEXT = ".live"
nameNoExt = Left(strIniFileName, InStr(strIniFileName, ".") - 1)
LiveFile = nameNoExt & liveEXT
'rename ini to live
'Name strIniFileName as strIniFileName & ".live"
Name strIniFileName as LiveFile
end if
Next
' Do I need to Go back to the root folder from where I want to search SubDirectories?
' At this point I could check to ensure no ini files exist - they should all be .live files
' If any exist - raise message
' Second Change all .drp file to .ini
For each drpFile in sf
' Check the email code for file in dir
If Not drpFile.FileExists("*.drp") Then
' If No ini file exists in this Subfolder Loop to next Folder
'loop to next sub directory
else
' Get the file name
Dim strDRPFileName as string
strDRPFileName = drpFile.name
' check this file extention
' there might be more than one drp file
' How do i check this?
' Use .GetExtensionName to check if its .ini perhaps?
if drpFile.GetExtensionName = ".drp"
' Or is this just "drp" (no .)?
dim nameNoExt1 as string
dim newEXT1 as string
Dim newINIFile as string
drpEXT = ".live"
nameNoExt1 = Left(strDRPFileName, InStr(strDRPFileName, ".") - 1)
newINIFile = nameNoExt & liveEXT
'rename ini to live
'Name strIniFileName as strIniFileName & ".live"
Name strDRPFileName as newINIFile
end if
Next
Next
End if ' End if - fld.SubFolders.Count > 0
|