It is currently Wed Jun 19, 2013 9:04 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: I wish few commands for easy read registry values ...
PostPosted: Tue Jun 26, 2012 3:54 pm 
Offline
New User
New User

Joined: Tue Jun 26, 2012 3:49 pm
Posts: 2
Hi.... :lol:

I wish few commands for easy read registry values - for example: getregvalue or writeregvalue or something else.

and I wish a command to read every file in a directory (recursive)


i would be very happy if this would be happen...... :wink:


Top
 Profile  
 
 Post subject: Re: I wish few commands for easy read registry values ...
PostPosted: Tue Jun 26, 2012 4:44 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2919
Location: Wales, UK
Quote:
commands for easy read registry values


+1 from me. There are numerous examples on the forum on how to do this.

Quote:
read every file in a directory (recursive)


Note entirely sure what you mean, can you expand?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: I wish few commands for easy read registry values ...
PostPosted: Tue Jun 26, 2012 5:21 pm 
Offline
New User
New User

Joined: Tue Jun 26, 2012 3:49 pm
Posts: 2
Quote:
read every file in a directory (recursive)


Note entirely sure what you mean, can you expand?[/quote]


Code:
  Directory$ = "C:\"   
  If ExamineDirectory(0, Directory$, "*.*") 
    While NextDirectoryEntry(0)
      If DirectoryEntryType(0) = #PB_DirectoryEntry_File
        Type$ = " [File] "
      Else
        Type$ = " [Sub-Dir] "
      EndIf
     
      Debug DirectoryEntryName(0) + Type$ + "- size in bytes: " + Str(DirectoryEntrySize(0))
    Wend
    FinishDirectory(0)
  EndIf



this list all files in a directory, but no subdirectorys are listed....
a command to list / read / write all files in all (sub)directorys would be great.
thats what i mean.


Top
 Profile  
 
 Post subject: Re: I wish few commands for easy read registry values ...
PostPosted: Tue Jun 26, 2012 5:29 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 1411
Location: Boston, MA
You must put another loop around the ExamineDirectory().
That way, you can search within each new directory you find.

_________________
To understand recursion, you must first understand recursion. ~ unknown
I never make stupid mistakes. Only very, very clever ones. ~ John Peel


Top
 Profile  
 
 Post subject: Re: I wish few commands for easy read registry values ...
PostPosted: Tue Jun 26, 2012 7:54 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2919
Location: Wales, UK
This is elsewhere on the forum, fast.

Code:
Procedure ListFilesRecursive(Dir.s, List Files.s())
  NewList Directories.s()
  If Right(Dir, 1) <> "\"
    Dir + "\"
  EndIf
  D = ExamineDirectory(#PB_Any, Dir, "")
  While NextDirectoryEntry(D)
    Select DirectoryEntryType(D)
      Case #PB_DirectoryEntry_File
        AddElement(Files())
        Files() = Dir + DirectoryEntryName(D)
      Case #PB_DirectoryEntry_Directory
        Select DirectoryEntryName(D)
          Case ".", ".."
            Continue
          Default
            AddElement(Directories())
            Directories() = Dir + DirectoryEntryName(D)
        EndSelect
    EndSelect
  Wend
  FinishDirectory(D)
  ForEach Directories()
    ListFilesRecursive(Directories(), Files())
  Next
EndProcedure

NewList F.s()
ListFilesRecursive("D:\Temp\", F())
ForEach F()
  Debug F()
Next

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye