dynamitemedia Posted November 5, 2014 Posted November 5, 2014 I have a folder that is called "plugins" it has some bat files and some txt files in the folder. I want to read the folder and list only the bat files int the list view and when i click it and it highlights i want to be able to pass that to the bat file. you can send variables to bat files in php etc so i assuming it can be done here too. Thank you very much
dynamitemedia Posted November 6, 2014 Author Posted November 6, 2014 (edited) wow i actually got it that quickly! for anyone who needs to know my code is like this: $List2 = GUICtrlCreateList("", 32, 88, 521, 174) GUICtrlSetFont(-1, 12, 400, 0, "Arial") Local $FileList = _FileListToArray("plugins", "*.bat*") For $i = 1 To $FileList[0] GUICtrlSetData($List2, RemoveExt(GetFileName($FileList[$i]))) Next the functions are like this and i got them here I wanted to not actually show extension either so i added the functions below ; ------------------ Functions --------------------------- Func RemoveExt($Input) Local $ExtArray = StringSplit($Input, ".") Return StringReplace($Input, "." & $ExtArray[$ExtArray[0]], "", -1) EndFunc Func RemoveExtRegExp($Input) Return StringRegExpReplace($Input, "\.[^.]*$", "") EndFunc Func GetFileName($Input) Local $PathArray = StringSplit($Input, "\/") Return $PathArray[$PathArray[0]] EndFunc Edited November 6, 2014 by dynamitemedia
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