Jump to content

folder reader


Recommended Posts

ı 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

Link to comment
Share on other sites

  • Developers

If StringInStr(FileGetAttrib($file), "D") > 0 Then
  ; Directory
Else
  ;File
EndIf

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...