sSpider Posted September 21, 2023 Posted September 21, 2023 (edited) here's the code i'm working on. it outputs to clipboard the directory contents. cant get no output from Local $cdir = FileGetAttrib($fname) ;----dosnt work nothing relaying on this code works downstream, leaving me with non-trailing \ on the directorys am i missing something here? #NoTrayIcon If $CmdLine[0] = 0 Then Exit Local $isfile = "" Local $fsearch = FileFindFirstFile($CmdLine[1] & "\*") If $fsearch = -1 Then Exit While 1 Local $fname = FileFindNextFile($fsearch) If @error Then ExitLoop Local $cdir = FileGetAttrib($fname) ;----dosnt work ConsoleWrite($cdir & @CRLF) Select Case StringInStr($cdir,"D") $isfile = $isfile & $CmdLine[1] & "\" & $fname & "\" & @CRLF Case Else $isfile = $isfile & $CmdLine[1] & "\" & $fname & @CRLF EndSelect WEnd ClipPut(StringTrimRight($isfile,2)) Beep(500,200) Exit Edited September 21, 2023 by Jos added codebox... please use <> next time.
Solution ioa747 Posted September 21, 2023 Solution Posted September 21, 2023 (edited) Edit: FileGetAttrib nedd full path not only the file name check the flag parameter on FileFindNextFile ( search [, flag = 0]) #NoTrayIcon If $CmdLine[0] = 0 Then Exit Local $isfile = "" Local $fsearch = FileFindFirstFile($CmdLine[1] & "\*") If $fsearch = -1 Then Exit While 1 Local $fname = FileFindNextFile($fsearch) If @error Then ExitLoop If @extended = 1 Then $isfile &= $CmdLine[1] & "\" & $fname & "\" & @CRLF ConsoleWrite("- Dir:" & $fname & @CRLF) Else ConsoleWrite(" file:" & $fname & @CRLF) $isfile &= $CmdLine[1] & "\" & $fname & @CRLF EndIf WEnd ClipPut(StringTrimRight($isfile, 2)) Beep(500, 200) Edited September 21, 2023 by ioa747 I know that I know nothing
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