PcExpert Posted September 14, 2006 Share Posted September 14, 2006 Hi, It possible to let AutoIt search for directories inside another directory? For exaple: You want to know the directory name from a directory that's in another directory. Can AutoIt do that? Thanks! Link to comment Share on other sites More sharing options...
/dev/null Posted September 14, 2006 Share Posted September 14, 2006 Hi,It possible to let AutoIt search for directories inside another directory? For exaple:You want to know the directory name from a directory that's in another directory. Can AutoIt do that?Thanks!FileFindFirstFile() and FileFindNextFile(). See help file sample.CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
yangmo Posted September 14, 2006 Share Posted September 14, 2006 (edited) I'm new here...I cant help...but learn from your post... Wish you to find the answer as soon as possible! ha! Edited September 14, 2006 by yangmo 地球人都知道走人要厚道!---Human being all know that it is important to be a generous man... Link to comment Share on other sites More sharing options...
PcExpert Posted September 14, 2006 Author Share Posted September 14, 2006 But what kind of extention do I have to put in to search for the names of the direcories then? Link to comment Share on other sites More sharing options...
BigDod Posted September 14, 2006 Share Posted September 14, 2006 If you do not want a recurrsive search then lookup _FileListToArray in the help file and look at the flags. 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 More sharing options...
Moderators SmOke_N Posted September 14, 2006 Moderators Share Posted September 14, 2006 (edited) Just put the directory you want to search...Func _DirRecurse($hDirectory) RunWait(@Comspec & ' /c dir /b /s /a "' & $hDirectory & '" > "' & _ @TempDir & '\RecursivOutput.txt"', @WorkingDir, @SW_HIDE) If Not FileExists(@TempDir & '\RecursivOutput.txt') Then Return SetError(1, 0, 0) Local $sFRead = FileRead(@TempDir & '\RecursivOutput.txt') FileDelete(@TempDir & '\RecursivOutput.txt') Return $sFRead EndFunc Edited September 14, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PcExpert Posted September 15, 2006 Author Share Posted September 15, 2006 OK, I'll explain what I want to do: I want to search for other user accounts, now I only know howto check the logged in user , but I want to check if there are more profiles. Is that possible? Link to comment Share on other sites More sharing options...
/dev/null Posted September 15, 2006 Share Posted September 15, 2006 OK, I'll explain what I want to do: I want to search for other user accounts, now I only know howto check the logged in user , but I want to check if there are more profiles. Is that possible? #include <file.au3> #include <array.au3> $profile_path = EnvGet("USERPROFILE") Dim $szDrive, $szDir, $szFile, $stExt $retarray = _PathSplit($profile_path,$szDrive,$szDir,$szFile,$stExt) $profile_dir = $szDrive & $szDir $profile_list = _FileToArray($profile_dir) _ArrayDisplay($profile_list,"All User Profiles") Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 15, 2006 Moderators Share Posted September 15, 2006 #include <file.au3> #include <array.au3> $profile_path = EnvGet("USERPROFILE") Dim $szDrive, $szDir, $szFile, $stExt $retarray = _PathSplit($profile_path,$szDrive,$szDir,$szFile,$stExt) $profile_dir = $szDrive & $szDir $profile_list = _FileToArray($profile_dir) _ArrayDisplay($profile_list,"All User Profiles") Cheers KurtThat's not a working example Kurt... I can see you did a me and probably typed in the fast reply window Did you mean something like?#include <file.au3> #include <array.au3> $profile_path = EnvGet("USERPROFILE") Dim $szDrive, $szDir, $szFile, $stExt $retarray = _PathSplit($profile_path,$szDrive,$szDir,$szFile,$stExt) $profile_dir = $szDrive & $szDir $profileList = _FileListToArray($profile_dir) _ArrayDisplay($profileList,"All User Profiles") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
/dev/null Posted September 15, 2006 Share Posted September 15, 2006 That's not a working example Kurt... I can see you did a me and probably typed in the fast reply window Did you mean something like?[autoit]#include <file.au3> Yep, you're right. _FileToArray should read _FileListToArray. Thanks. Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
MHz Posted September 15, 2006 Share Posted September 15, 2006 OK, I'll explain what I want to do: I want to search for other user accounts, now I only know howto check the logged in user , but I want to check if there are more profiles. Is that possible?#include <file.au3> #include <array.au3> $profile_path = @HomeDrive & @HomePath ConsoleWrite($profile_path & @CRLF) Dim $szDrive, $szDir, $szFile, $stExt $retarray = _PathSplit($profile_path,$szDrive,$szDir,$szFile,$stExt) $profile_dir = $szDrive & $szDir $profileList = _FileListToArray($profile_dir) _ArrayDisplay($profileList,"All Profile Folders") Just a mod to some previous copied code to get all profile folders in "HomePath". Link to comment Share on other sites More sharing options...
/dev/null Posted September 15, 2006 Share Posted September 15, 2006 Just a mod to some previous copied code to get all profile folders in "HomePath". Even shorter with @UserProfileDir #include <file.au3> #include <array.au3> Dim $szDrive, $szDir, $szFile, $stExt $retarray = _PathSplit(@UserPofileDir,$szDrive,$szDir,$szFile,$stExt) $all_profiles_dir = $szDrive & $szDir $profile_list = _FileListToArray($all_profiles_dir) _ArrayDisplay($profile_list,"All Profile Folders") Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
PcExpert Posted September 16, 2006 Author Share Posted September 16, 2006 (edited) Thanks all! Edited September 16, 2006 by PcExpert 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