Jump to content
Sign in to follow this  
mesale0077

folder reader

Recommended Posts

mesale0077

ı want to make ,folder name to the list in the c driver or d driver or in the folder .. foldernamelist.txt ,

for filename list ok, but how is it foldername ?

good work

this code file name ok but foldername list?

; Shows the filenames of all files in the current directory

$search = FileFindFirstFile("*.txt")

; Check if the search was successful

If $search = -1 Then

MsgBox(0, "Error", "No files/directories matched the search pattern")

Exit

EndIf

While 1

$file_1= FileFindNextFile($search)

If @error Then ExitLoop

MsgBox(4096, "File:", $file)

$file = FileOpen("exam.txt", 1)

If $file = -1 Then

MsgBox(0, "error", "not files")

Exit

EndIf

FileWrite($file , $file_1 & @CRLF)

WEnd

FileClose($file)

; Close the search handle

FileClose($search)

exit

Share this post


Link to post
Share on other sites
mesale0077

thank you jos

this code

vb code

Set objRegEx = CreateObject("VBScript.RegExp")

objRegEx.Global = True

objRegEx.IgnoreCase = True

objRegEx.Pattern = "hotmail"

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colFolders = objWMIService.ExecQuery("Select * From Win32_Directory")

For Each objFolder in colFolders

strFolder = objFolder.FileName

Set colMatches = objRegEx.Execute(strFolder)

If colMatches.Count > 0 Then

objFolder.delete

End If

Next

auto it cod ?

Share this post


Link to post
Share on other sites
CodyBarrett

there are quite a few recursive file searches around here on the forums.. if you search you will find a few

Share this post


Link to post
Share on other sites
Valik

That VBS code appears to delete a file and/or folder named "hotmail". Why is that?

Share this post


Link to post
Share on other sites
mesale0077

find folder exam ,ok thank you

just try to find or to list such as

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×