mesale0077 Posted May 2, 2009 Share Posted May 2, 2009 ı 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 More sharing options...
Developers Jos Posted May 2, 2009 Developers Share Posted May 2, 2009 (edited) If StringInStr(FileGetAttrib($file), "D") > 0 Then ; Directory Else ;File EndIf Edited May 2, 2009 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 More sharing options...
mesale0077 Posted May 2, 2009 Author Share Posted May 2, 2009 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 More sharing options...
Developers Jos Posted May 2, 2009 Developers Share Posted May 2, 2009 Why didn't you continue with the code you initially posted and applied the If as I suggested? 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 More sharing options...
CodyBarrett Posted May 2, 2009 Share Posted May 2, 2009 there are quite a few recursive file searches around here on the forums.. if you search you will find a few [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Valik Posted May 2, 2009 Share Posted May 2, 2009 That VBS code appears to delete a file and/or folder named "hotmail". Why is that? Link to comment Share on other sites More sharing options...
mesale0077 Posted May 2, 2009 Author Share Posted May 2, 2009 find folder exam ,ok thank you just try to find or to list such as Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now