Jump to content

file search script


roadrunner
 Share

Recommended Posts

I'm new to auti 3 so be gentle

i have been tring to write a script that will just search all the hard drives on the computer and report back if it there, sound simple but i'm stuck.

does anyone have a script that does this or could someone tell how to

get a script to get a listing of directorys and then change through the directorys

any help welcome :whistle:

Link to comment
Share on other sites

I'm new to auti 3  so be gentle

i have been tring to write a script that will just search  all the hard drives on the computer and report back if it there,  sound simple  but i'm stuck.

does anyone have a script that does this or could someone tell how to

get a script to get a listing of directorys and then change  through the directorys

any help welcome :whistle:

<{POST_SNAPBACK}>

I think that this post belongs in V3 Support.

Posdt what you have written so far and someone may help.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

[edit] used set prior to speed it up [/edit]

;let's build an array of subfolders

$aFolder = _GetFileList("C:\", '/S')

For $i = 1 to Ubound($aFolder)-1
    ConsoleWrite($aFolder[$i] & @LF)
Next

Func _GetFileList($s_Folder, $s_Switch = '')
;---------------------------------------------------------------------------------------------------
;$psSwitch can be the following kinds of things:
;   /AD     list folders only
;   /A-D       list files only
;   /S /AD   list all folders and subfolders recursively
;   /A-D /OE   list only files, and group them by extension
;
; <<< parameters to the DIR command >>>
;
;   /A        Displays files with specified attributes.
;   attributes   D  Directories             R  Read-only files
;                H  Hidden files               A  Files ready for archiving
;                S  System files               -  Prefix meaning not
;   /O        List by files in sorted order.
;   sortorder   N  By name (alphabetic)    S  By size (smallest first)
;                E  By extension (alphabetic)  D  By date & time (earliest first)
;                G  Group directories first -  Prefix to reverse order
;   /T        Controls which time field displayed or used for sorting
;   timefield   C  Creation
;               A  Last Access
;               W  Last Written
;   /S        Displays files in specified directory and all subdirectories.
;   /X        This displays the short names generated for non-8dot3 file
;               names.  The format is that of /N with the short name inserted
;               before the long name. If no short name is present, blanks are
;               displayed in its place.
;---------------------------------------------------------------------------------------------------
    
    Local $s_r = ''
    Local $p_pid = Run(@COMSPEC & " /c DIR /B " & $s_Switch & ' "' & $s_Folder & '"', "", @SW_HIDE, 2)
    
    ProcessSetPriority($p_pid, 5)
    
    While Not @error
        $s_r &= StdoutRead($p_pid)
    WEnd
    
    Return StringSplit(StringTrimRight(StringReplace($s_r, @CRLF, @LF), 1),@LF)

EndFunc
Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

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...