Radio Spider Script Solution

The late Kevin Watkins solved the problem of Microsoft's folder flaw June 29, 2017

The only thing Radio Spider can’t do is handle random data in folder path name — because you can’t use wild characters to find a folder, which is a design flaw in the way Microsoft handles folders. But a script created by the late Kevin Watkins, shared below with permission, solves that issue. Alternatively, you can view it in PDF form here: /portals/0/radio spider script.pdf

 

 

music_script edit.vbs

 

' script to check for version number in folder and remove it if found

' Created 7/15/2014 for Al Simpson -Kevin Watkins

 

' setup

Dim fso, folder, Subfolder, newfolder

Dim pos,space

 

Set objShell = CreateObject("Wscript.Shell")

Set FSO = CreateObject("Scripting.FileSystemObject")

 

if WScript.Arguments.Count = 0 then

   

end if

 

' Set default directory to C:\MRMASTER

objShell.CurrentDirectory = "C:\MRMASTER"

Set folder = FSO.GetFolder(".")

 

' Loop through folder names removing revision/version numbers

    For Each Subfolder in Folder.SubFolders

               ' find the word "for" and check the number prior for a period before it. 

               ' If found, rename without the version number first checking to see if

               ' the folder exists and remove it if it does.

               Pos = Instr(Subfolder," for ")

               If Pos then

                              if mid(Subfolder,(Pos-3),1) <> "." then

                                             'Find Space

                                             space = Instr(Pos-5,Subfolder," ")

                                             newfolder = Left(Subfolder,space) & right(Subfolder,len(subfolder)-pos)

                                             if (fso.FolderExists(newfolder)) then

                                                            if WScript.Arguments.Count > 0 then FSO.DeleteFolder(newfolder)

                                             end if

                              if WScript.Arguments.Count > 0 then FSO.MoveFolder subfolder, newfolder

                              end if

               end if

    Next

 

objShell.CurrentDirectory = "C:\MRMASTER"

Set folder = FSO.GetFolder(".")

 

' Loop through folder names removing WITH xxxxx

    For Each Subfolder in Folder.SubFolders

               ' find the word "WITH" and remove all text up to date

               ' If found, rename without the extra info first checking to see if

               ' the folder exists and remove it if it does.

               Pos = Instr(Subfolder," WITH ")

               If Pos then

                              Pos2 = Instr(Pos,Subfolder,".")

                              If Pos2 Then

                                             newfolder = Left(Subfolder,Pos) & right(Subfolder,len(subfolder)-pos2+3)

                                             Pos3 = Instr(1,newfolder, "REVISED")

                                                            If Pos3 then newfolder = right(newfolder,len(newfolder)-20)

                                             if (fso.FolderExists(newfolder)) then

                                                            if WScript.Arguments.Count > 0 then FSO.DeleteFolder(newfolder)

                                             end if

                              if WScript.Arguments.Count > 0 then FSO.MoveFolder subfolder, newfolder

                              end if

               end if

    Next

 

 

Receive regular news and technology updates. Sign up for our free newsletter here.

Comments