Re: stupid question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



preet wrote:

Actually these names of folders

i have a menu script and i wish to avoid certain files and certain
folders from being displayed in the script

so for comparision we take them as pure names nothing else

no binary comparisons

since i presume the number of files or folders to be ignored will be
huge, i wish to avoid multiple AND


and put <> (comp1, comp2, comp3, comp4)

this is what i wish to find out

Assuming you have the list of files stored in an array, you could loop
through them and set a Boolean flag if the name is found.

'Create a demo list in MyArray
Dim MyArray(2)
MyArray(0) = "zero"
MyArray(1) = "one"
MyArray(2) = "two"

name = "foo" 'Name to find

found = false 'initialize flag

For i = Lbound(MyArray) To Ubound(MyArray)
If Ucase(name) = Ucase(MyArray(i)) Then
found = true 'item was found so toggle flag
Exit For 'and abort the search
End If
Next

If found Then 'report status
msgbox name & " was found in list.",,"Found"
Else
msgbox name & " was NOT found in list.",,"NOT Found"
End If


--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


.



Relevant Pages

  • Re: stupid question
    ... Actually these names of folders ... i have a menu script and i wish to avoid certain files and certain ...
    (microsoft.public.scripting.vbscript)
  • Re: CLean out all users Temp Dir Folder
    ... I've built the script you need with ScriptAhead a tool we have just ... ' Get Folders that match the following criteria: ... Sub AppendCollectionToArray ... GetSubFolders strFolderName ...
    (microsoft.public.windows.server.scripting)
  • RE: Deleting 1 folder across multiple Mailboxes
    ... I too am looking to delete about 30 folders that came over from a linux ... are over 200 mailboxes that is a whole lot of click delete click delete. ... I found this script, but it seems to only work on Exchange 2000. ... Dim objCommand, objConnection, strBase, strFilter, strAttributes ...
    (microsoft.public.exchange.admin)
  • Re: Need help for a new scripter
    ... been tasked with comming up with a script that will allow me to move ... folders from the profile into it. ... Dim sUserProfile, sBUPath ... sPath & "\quicklaunch", OverWriteFiles ...
    (microsoft.public.scripting.vbscript)
  • Re: Script for Folder View Customization - Beta
    ... but vbcsript's capabilities are equal to or better than our ... Should be no problem for folders such as "c:\docs & ... the file system object, SAPI.SpFileStream, SAPI.Voice, etc. ... I also wrote a script that recurses a folder hierarchy and calls SAPI5 ...
    (microsoft.public.scripting.vbscript)