Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

PBCC Code To Walk Registry & Check Path References

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Donald Darden
    replied
    New Optimization

    'I decided the program could be optimized a bit more, and made a bit more consistent to the style I normally use.
    Code:
     #COMPILE EXE '#CC 4.03#
    #INCLUDE "Win32Api.Inc" '2003-03-27
    
    GLOBAL hDlg  AS DWORD
    GLOBAL hList AS DWORD
    %Listbox1 = 101
    
    GLOBAL pick AS STRING, entry AS STRING, fileref AS STRING, pause AS LONG
    GLOBAL cBack AS LONG, abort AS LONG
    '______________________________________________________________________________
    
     'Registry Element Size Limits
     'The following table identifies the size limits for the various registry elements.
    
     'Key name
     ' 255 characters
    
     'Value name
     ' 95/98/Me    255 characters
     ' 2000        260 characters ANSI
     ' 2000    16,383 characters Unicode
     ' other    16,383 characters
    
     'Value
     ' Available memory (latest format)
     ' 1MB (standard format)
     ' Me/98/95: 16,300 bytes.
    
     'For Windows 95, there is a 64K limit for the total size of all values of a key.
    '______________________________________________________________________________
    
     'REG_NONE                No defined value type.(0)
     'REG_SZ                  A null-terminated string. It will be a Unicode or ANSI string,
     '                        depending on whether you use the Unicode or ANSI functions.(1)
     'REG_EXPAND_SZ              A null-terminated string that contains unexpanded references to
     '                        environment variables (for example, "%PATH%").
     '                        It will be a Unicode or ANSI string depending on whether you use
     '                        the Unicode or ANSI functions.(2)
     'REG_BINARY              Binary data in any form. (3)
     'REG_DWORD               A 32-bit number.(4)
     'REG_DWORD_LITTLE_ENDIAN A 32-bit number in little-endian format (same as REG_DWORD).
     '                        In little-endian format, the most significant byte of a word
     '                        is the high-order byte. This is the most common format for
     '                        computers running Windows NT and Windows 95.(4)
     'REG_DWORD_BIG_ENDIAN    A 32-bit number in big-endian format. In big-endian format,
     '                        the most significant byte of a word is the low-order byte.(5)
     'REG_LINK                A Unicode symbolic link.(6)
     'REG_MULTI_SZ            An array of null-terminated strings, terminated by two null characters.(7)
     'REG_RESOURCE_LIST       A device-driver resource list.(8)
    '______________________________________________________________________________
    
    FUNCTION GetSizeOfFile(FileSpec AS ASCIIZ, DateTime AS STRING) AS DOUBLE
      LOCAL FindData AS WIN32_FIND_DATA
      LOCAL systime AS SYSTEMTIME
      LOCAL ft AS FILETIME
      LOCAL szModifyDate AS ASCIIZ *36
      LOCAL szModifyTime AS ASCIIZ * 36
      LOCAL szSizeFormat AS ASCIIZ * 16
      LOCAL szDF  AS ASCIIZ * 36
      LOCAL szTF AS ASCIIZ * 36
      LOCAL l_hFindFile AS DWORD
    
      ' the formats in which dates and times are returned
      szDF        = "MM'/'dd'/'yy"
      szTF        = "hh':'mm':'ss tt"
      szSizeFormat = "###,###,###"
    
      FileSpec = TRIM$(FileSpec)
      l_hFindFile = FindFirstFile(FileSpec, FindData)
      IF l_hFindFile = %INVALID_HANDLE_VALUE THEN
        FUNCTION = -1
      ELSE
        FUNCTION = FindData.nFileSizeHigh * &H100000000 + FindData.nFileSizeLow
        FileTimeToLocalFileTime FindData.ftLastWriteTime, ft
        FileTimeToSystemTime ft, SysTime
        GetDateFormat BYVAL %NULL, BYVAL %NULL, SysTime, szDf, szModifyDate, SIZEOF (szModifyDate)
        GetTimeFormat BYVAL %NULL, BYVAL %NULL, SysTime, szTF, szModifyTime, SIZEOF (szModifyTime)
        DateTime = szModifyDate & " " & szModifyTime
        FindClose l_hFindFile
      END IF
    END FUNCTION
    
    
    FUNCTION EnumValue(MainKey AS LONG, zStartHere AS ASCIIZ) AS LONG
     LOCAL zValueName    AS ASCIIZ * 16384
     LOCAL sData        AS STRING * 16384 'Can be bigger
     LOCAL Buffer        AS STRING
     LOCAL hKey          AS DWORD
     LOCAL dwIndex      AS DWORD
     LOCAL dwType        AS DWORD
     LOCAL ListCount    AS DWORD
     LOCAL ValueNameSize AS LONG
     LOCAL DataSize      AS LONG
     LOCAL Retval        AS LONG
     LOCAL Counter      AS LONG
     IF RegOpenKeyEx(MainKey, zStartHere, 0, %KEY_READ, hKey) = %ERROR_SUCCESS THEN
     'IF RegOpenKey(Key, zStartHere, hKey) = %ERROR_SUCCESS THEN
      dwIndex = 0
      DO UNTIL abort
        ValueNameSize = SIZEOF(zValueName)
        DataSize = SIZEOF(sData)
        Retval = RegEnumValue(hKey, dwIndex, zValueName, ValueNameSize, _
                              BYVAL %NULL,dwType, sData, DataSize)
        IF Retval <> %ERROR_SUCCESS THEN EXIT DO
        Buffer = LEFT$(zValueName, ValueNameSize)
        IF Buffer = "" THEN Buffer = "(Default)"
        entry = entry & Buffer & " = "
        SELECT CASE dwType
        CASE %REG_SZ
          entry = entry & LEFT$(sData, DataSize - 1) & " (REG_SZ)"
        CASE %REG_EXPAND_SZ
          entry = entry & LEFT$(sData, DataSize - 1) & " (REG_EXPAND_SZ)"
        CASE %REG_BINARY
          FOR Counter = 1 TO DataSize
            entry = entry & " " & HEX$(ASC(sData, Counter),2)
          NEXT
          entry = entry & " (REG_BINARY " & FORMAT$(DataSize) & " bytes)
        CASE %REG_DWORD
          entry = entry & STR$(CVDWD(sData)) & " (REG_DWORD)"
        CASE %REG_MULTI_SZ
          REPLACE $NUL WITH ", " IN sData
          entry = entry & LEFT$(sData, DataSize - 2) & " (REG_MULTI_SZ)"
        CASE ELSE
          entry = entry & " (REG Data type is" & STR$(dwType) & ")"
        END SELECT
        INCR dwIndex
      LOOP
      RegCloseKey hKey
     END IF
    END FUNCTION
    '______________________________________________________________________________
    
    FUNCTION EnumKey(MainKey AS LONG, zStartHere AS ASCIIZ) AS LONG
     LOCAL zBuf          AS ASCIIZ * 256
     LOCAL zClass        AS ASCIIZ * 256
     LOCAL LastWriteTime AS FILETIME
     LOCAL ListCount     AS DWORD
     LOCAL dwIndex       AS LONG
     LOCAL BufLen        AS LONG
     LOCAL ClassLen      AS LONG
     LOCAL RetVal        AS LONG
     LOCAL hKey          AS LONG
     STATIC fault        AS LONG
     STATIC dtg          AS STRING
     STATIC Temp1        AS LONG
     STATIC Temp2        AS LONG
     
     IF RegOpenKeyEx(MainKey, zStartHere, 0, %KEY_ENUMERATE_SUB_KEYS, hKey) = %ERROR_SUCCESS THEN
      EnumValue MainKey, zStartHere 'Search for ValueName and Data
      DO UNTIL abort
      '  BufLen  = 256
      '  ClassLen = 256
        Retval = RegEnumKeyEx(hKey, dwIndex, zBuf, 256, 0, zClass, 256, LastWriteTime)
        IF Retval = %ERROR_SUCCESS THEN
          IF LEN(zbuf) THEN
            entry=entry & $LF & "    " & zBuf
            EnumKey MainKey, zStartHere & "\" & zBuf 'Do a recursive search for more entry..
          END IF
        ELSE
          EXIT DO
        END IF
        INCR dwIndex
      LOOP
      RegCloseKey hKey
      IF LEN(entry) THEN
        IF cBack=0 THEN
          COLOR 15,1
          Temp1=0
          DO
            Temp2=INSTR(Temp1+1,entry,$LF)
            IF Temp2=0 THEN
              PRINT REMOVE$(MID$(entry,Temp1+1),$NUL)
              EXIT DO
            END IF
            PRINT REMOVE$(MID$(entry,Temp1+1,Temp2-Temp1-1),$NUL)
            Temp1=Temp2
          LOOP
        END IF
        BufLen=0
        DO UNTIL abort
          REGEXPR "[a-z]:\\" IN entry AT BufLen+1 TO BufLen
          IF BufLen=0 THEN EXIT DO
          IF ASC(entry,BufLen-1)=34 THEN
            RetVal=INSTR(BufLen,entry,CHR$(34))
          ELSE
            RetVal=INSTR(BufLen,entry," (REG")
            IF RetVal=0 THEN RetVal=LEN(entry)+1
            ClassLen=BufLen+2
            IF INSTR(entry,"+Silent") THEN
              BufLen=BufLen
            END IF
            DO
              temp1=INSTR(ClassLen+1,entry,"\")
              IF Temp1>RetVal THEN Temp1=0
              IF Temp1 THEN
                ClassLen=Temp1
              ELSE
                DO
                  Temp1=INSTR(ClassLen,entry, ".")
                  IF Temp1 AND Temp1<RetVal THEN
                    ClassLen=Temp1+1
                  ELSE
                    Temp1=INSTR(ClassLen,entry, ANY " ,+;:")
                    IF Temp1 AND Temp1<RetVal THEN ClassLen=Temp1-1
                    EXIT DO
                  END IF
                LOOP
                EXIT DO
              END IF
            LOOP
            IF ClassLen>BufLen THEN
              REGEXPR " [%\-/\q=\^]" IN entry AT BufLen TO ClassLen
              IF ClassLen AND ClassLen<RetVal THEN RetVal=ClassLen
              ClassLen=INSTR(BufLen, entry, ",")
            END IF
            IF ClassLen AND ClassLen<RetVal THEN RetVal=ClassLen
          END IF
          fault=0
          IF RetVal>BufLen+3 THEN
            fileref=RTRIM$(MID$(entry,BufLen,RetVal-BufLen),"\")
            fault=DIR$(fileref,23)=""
            IF fault THEN
              IF cBack THEN
                COLOR 15,1-cBack
                Temp1=0
                DO
                  Temp2=INSTR(Temp1+1,entry,$LF)
                  IF Temp2=0 THEN
                    PRINT MID$(entry,Temp1+1)
                    EXIT DO
                  END IF
                  PRINT MID$(entry,Temp1+1,Temp2-Temp1-1)
                  Temp1=Temp2
                LOOP
              END IF
              COLOR 14,6  'Bright Yellow on Yellow means path\file not found
            ELSE
              COLOR 14,1-cBack  'Yellow on Blue just marks where a path\file reference is
            END IF
            PRINT fileref;SPACE$(SCREENX-CURSORX);
            COLOR 15,1-cBack
            PRINT
          END IF
          IF fault THEN
            FOR Temp1=ASC("C") TO ASC("Z")
              MID$(fileref,1)=CHR$(Temp1)
              IF DIR$(fileref,23)>"" THEN
                COLOR 14,2  'Yellow on Green means file found, different drive
                PRINT fileref;
                PRINT TAB(64)USING$("###,###,###,###  ",GetSizeOfFile((fileref),dtg))dtg;
                COLOR 15,1-cBack
                PRINT
              END IF
            NEXT
            DO UNTIL abort
              SLEEP 0
              dtg=INKEY$
              IF LEN(dtg) THEN
                SELECT CASE pick
                CASE $TAB
                  pause=NOT pause
                CASE $CR
                  cBack=1-cBack
                CASE $ESC
                  abort=-1
                END SELECT
                EXIT DO
              END IF
            LOOP
          ELSE
            ' SLEEP 200
          END IF
          BufLen=RetVal
        LOOP
        entry=""
      END IF
     END IF
     DO UNTIL abort
       SLEEP 0
       dtg=INKEY$
       IF LEN(dtg) THEN
         SELECT CASE dtg
         CASE $TAB
           pause=NOT pause
         CASE $CR
           cBack=1-cBack
         CASE $ESC
           abort=-1
         CASE " "
           EXIT DO
         END SELECT
       ELSE
         IF pause=0 THEN EXIT DO
       END IF
     LOOP
    END FUNCTION
    '______________________________________________________________________________
    
    FUNCTION PBMAIN
     LOCAL zStartHere AS ASCIIZ * 256
     LOCAL hKey AS LONG, nKey AS LONG, KeyName AS STRING,label AS STRING
     COLOR 15,1
     CONSOLE SCREEN 45,100
     CLS
     CONSOLE NAME "Registry walk - Please wait..."
     FOR nKey = 1 TO 9
      SELECT CASE nKey
      CASE 1
        HKey=%HKEY_CLASSES_ROOT
        KeyName="HKEY_CLASSES_ROOT"
      CASE 2
        HKey=%HKEY_CURRENT_USER
        KeyName="HKEY_CURRENT_USER"
      CASE 3
        HKey=%HKEY_LOCAL_MACHINE
        KeyName="HKEY_LOCAL_MACHINE"
      CASE 4
        HKey=%HKEY_USERS
        KeyName="HKEY_USERS"
      CASE 5
        HKEY=%HKEY_PERFORMANCE_DATA
        KeyName="HKEY_PERFORMANCE_DATA"
      CASE 6
        HKey=%HKEY_PERFORMANCE_TEXT
        KeyName="HKEY_PERFORMANCE_TEXT"
      CASE 7
        HKey=%HKEY_PERFORMANCE_NLSTEXT
        KeyName="HKEY_PERFORMANCE_NLSTEXT"
      CASE 8
        HKey=%HKEY_CURRENT_CONFIG
        KeyName="HKEY_CURRENT_CONFIG"
      CASE 9
        HKey=%HKEY_DYN_DATA
        KeyName="HKEY_DYN_DATA"
      END SELECT
      label=STRING$(SCREENX, "-")
      MID$(label,(LEN(label)-LEN(KeyName))\2)=KeyName
      PRINT LEFT$(label,LEN(label)-1)
      zStartHere = ""                                'Change to your need
      CONSOLE NAME "Registry Walk & Check of Path References - " & KeyName
      PRINT "zStartHere = " zStartHere
      IF abort THEN
        DO
          label=INKEY$
          IF LEN(label) THEN
            SELECT CASE label
            CASE $TAB
              pause=NOT pause
            CASE $CR
              cBack=1-cBack
            CASE $ESC
              EXIT DO
            END SELECT
            abort=0
            EXIT DO
          END IF
        LOOP
      END IF
      entry=""
      EnumKey HKey, zStartHere
     NEXT
     PRINT
     PRINT "Press any key or click to continue..."
     MOUSE ON
     MOUSE 3, UP
     WAITKEY$
    END FUNCTION

    Leave a comment:


  • PBCC Code To Walk Registry & Check Path References

    Code:
    #COMPILE EXE '#CC 4.03#
    #INCLUDE "Win32Api.Inc" '2003-03-27
    
    GLOBAL hDlg  AS DWORD
    GLOBAL hList AS DWORD
    %Listbox1 = 101
    
    GLOBAL pick AS STRING, entry AS STRING, fileref AS STRING, pause AS LONG
    GLOBAL cBack AS LONG
    '______________________________________________________________________________
    
     'Registry Element Size Limits
     'The following table identifies the size limits for the various registry elements.
    
     'Key name
     ' 255 characters
    
     'Value name
     ' 95/98/Me    255 characters
     ' 2000        260 characters ANSI
     ' 2000     16,383 characters Unicode
     ' other    16,383 characters
    
     'Value
     ' Available memory (latest format)
     ' 1MB (standard format)
     ' Me/98/95: 16,300 bytes.
    
     'For Windows 95, there is a 64K limit for the total size of all values of a key.
    '______________________________________________________________________________
    
     'REG_NONE                No defined value type.(0)
     'REG_SZ                  A null-terminated string. It will be a Unicode or ANSI string,
     '                        depending on whether you use the Unicode or ANSI functions.(1)
     'REG_EXPAND_SZ               A null-terminated string that contains unexpanded references to
     '                        environment variables (for example, "%PATH%").
     '                        It will be a Unicode or ANSI string depending on whether you use
     '                        the Unicode or ANSI functions.(2)
     'REG_BINARY              Binary data in any form. (3)
     'REG_DWORD               A 32-bit number.(4)
     'REG_DWORD_LITTLE_ENDIAN A 32-bit number in little-endian format (same as REG_DWORD).
     '                        In little-endian format, the most significant byte of a word
     '                        is the high-order byte. This is the most common format for
     '                        computers running Windows NT and Windows 95.(4)
     'REG_DWORD_BIG_ENDIAN    A 32-bit number in big-endian format. In big-endian format,
     '                        the most significant byte of a word is the low-order byte.(5)
     'REG_LINK                A Unicode symbolic link.(6)
     'REG_MULTI_SZ            An array of null-terminated strings, terminated by two null characters.(7)
     'REG_RESOURCE_LIST       A device-driver resource list.(8)
    '______________________________________________________________________________
    
    FUNCTION GetSizeOfFile(FileSpec AS ASCIIZ, DateTime AS STRING) AS DOUBLE
      LOCAL FindData AS WIN32_FIND_DATA
      LOCAL systime AS SYSTEMTIME
      LOCAL ft AS FILETIME
      LOCAL szModifyDate AS ASCIIZ *36
      LOCAL szModifyTime AS ASCIIZ * 36
      LOCAL szSizeFormat AS ASCIIZ * 16
      LOCAL szDF  AS ASCIIZ * 36
      LOCAL szTF AS ASCIIZ * 36
      LOCAL l_hFindFile AS DWORD
    
      ' the formats in which dates and times are returned
      szDF         = "MM'/'dd'/'yy"
      szTF         = "hh':'mm':'ss tt"
      szSizeFormat = "###,###,###"
    
      FileSpec = TRIM$(FileSpec)
      l_hFindFile = FindFirstFile(FileSpec, FindData)
      IF l_hFindFile = %INVALID_HANDLE_VALUE THEN
        FUNCTION = -1
      ELSE
        FUNCTION = FindData.nFileSizeHigh * &H100000000 + FindData.nFileSizeLow
        FileTimeToLocalFileTime FindData.ftLastWriteTime, ft
        FileTimeToSystemTime ft, SysTime
        GetDateFormat BYVAL %NULL, BYVAL %NULL, SysTime, szDf, szModifyDate, SIZEOF (szModifyDate)
        GetTimeFormat BYVAL %NULL, BYVAL %NULL, SysTime, szTF, szModifyTime, SIZEOF (szModifyTime)
        DateTime = szModifyDate & " " & szModifyTime
        FindClose l_hFindFile
      END IF
    END FUNCTION
    
    
    FUNCTION EnumValue(MainKey AS LONG, zStartHere AS ASCIIZ) AS LONG
     LOCAL zValueName    AS ASCIIZ * 16384
     LOCAL sData         AS STRING * 16384 'Can be bigger
     LOCAL Buffer        AS STRING
     LOCAL hKey          AS DWORD
     LOCAL dwIndex       AS DWORD
     LOCAL dwType        AS DWORD
     LOCAL ListCount     AS DWORD
     LOCAL ValueNameSize AS LONG
     LOCAL DataSize      AS LONG
     LOCAL Retval        AS LONG
     LOCAL Counter       AS LONG
    
     IF pick=$ESC THEN EXIT FUNCTION
    
     IF RegOpenKeyEx(MainKey, zStartHere, 0, %KEY_READ, hKey) = %ERROR_SUCCESS THEN
     'IF RegOpenKey(Key, zStartHere, hKey) = %ERROR_SUCCESS THEN
       dwIndex = 0
       DO WHILE pick<>$ESC
         SLEEP 0
         ValueNameSize = SIZEOF(zValueName)
         DataSize = SIZEOF(sData)
         Retval = RegEnumValue(hKey, dwIndex, zValueName, ValueNameSize, _
                               BYVAL %NULL,dwType, sData, DataSize)
         IF Retval <> %ERROR_SUCCESS THEN EXIT DO
         Buffer = LEFT$(zValueName, ValueNameSize)
         IF Buffer = "" THEN Buffer = "(Default)"
         SELECT CASE dwType
    
           CASE %REG_SZ
             Buffer = Buffer & " = " & LEFT$(sData, DataSize - 1) & " (REG_SZ)"
    
           CASE %REG_EXPAND_SZ
             Buffer = Buffer & " = " & LEFT$(sData, DataSize - 1) & " (REG_EXPAND_SZ)"
    
           CASE %REG_BINARY
             Buffer = Buffer & " = "
             FOR Counter = 1 TO DataSize
               Buffer = Buffer & " " & HEX$(ASC(sData, Counter),2)
             NEXT
             Buffer = Buffer & " (REG_BINARY " & FORMAT$(DataSize) & " bytes)
    
           CASE %REG_DWORD
             Buffer = Buffer & " = " & STR$(CVDWD(sData)) & " (REG_DWORD)"
    
           CASE %REG_MULTI_SZ
             REPLACE $NUL WITH ", " IN sData
             Buffer = Buffer & " = " & LEFT$(sData, DataSize - 2) & " (REG_MULTI_SZ)"
    
           CASE ELSE
             Buffer = Buffer & " (REG Data type is" & STR$(dwType) & ")"
    
         END SELECT
         entry=entry & " " & Buffer
         INCR dwIndex
       LOOP
       RegCloseKey hKey
     END IF
    
    END FUNCTION
    '______________________________________________________________________________
    
    FUNCTION EnumKey(MainKey AS LONG, zStartHere AS ASCIIZ) AS LONG
     LOCAL zBuf          AS ASCIIZ * 256
     LOCAL zClass        AS ASCIIZ * 256
     LOCAL LastWriteTime AS FILETIME
     LOCAL ListCount     AS DWORD
     LOCAL dwIndex       AS LONG
     LOCAL BufLen        AS LONG
     LOCAL ClassLen      AS LONG
     LOCAL RetVal        AS LONG
     LOCAL hKey          AS LONG
     STATIC fault        AS LONG
     STATIC dtg          AS STRING
     STATIC Temp1        AS LONG
     STATIC Temp2        AS LONG
    
     IF pick=$ESC THEN EXIT FUNCTION
    
     IF RegOpenKeyEx(MainKey, zStartHere, 0, %KEY_ENUMERATE_SUB_KEYS, hKey) = %ERROR_SUCCESS THEN
       EnumValue MainKey, zStartHere 'Search for ValueName and Data
       DO WHILE pick<>$ESC
         SLEEP 0
         BufLen   = 256
         ClassLen = 256
         Retval = RegEnumKeyEx(hKey, dwIndex, zBuf, BufLen, 0, zClass, ClassLen, LastWriteTime)
         IF Retval <> %ERROR_SUCCESS THEN EXIT DO
         IF RIGHT$(entry,1)<>$LF THEN entry=RTRIM$(entry & $LF & "    " & zBuf)
         EnumKey MainKey, TRIM$(zStartHere & "\" & zBuf,"\") 'Do a recursive search for more entry..
         INCR dwIndex
       LOOP
       RegCloseKey hKey
       entry=TRIM$(entry,ANY "\ ")
       IF LEN(entry) THEN
         IF pick<>$ESC AND cBack=0 THEN
           COLOR 15,1-cBack
           PRINT entry
         END IF
         BufLen=0
         DO WHILE pick<>$ESC
           SLEEP 0
           REGEXPR "[a-z]:\\" IN entry AT BufLen+1 TO BufLen
           IF BufLen=0 THEN EXIT DO
           IF ASC(entry,BufLen-1)=34 THEN
             RetVal=INSTR(BufLen,entry,CHR$(34))
           ELSE
             RetVal=INSTR(BufLen,entry," (REG")
             IF RetVal=0 THEN RetVal=LEN(entry)+1
             ClassLen=BufLen+2
             IF INSTR(entry,"+Silent") THEN
               BufLen=BufLen
             END IF
             DO
               temp1=INSTR(ClassLen+1,entry,"\")
               IF Temp1>RetVal THEN Temp1=0
               IF Temp1 THEN
                 ClassLen=Temp1
               ELSE
                 DO
                   Temp1=INSTR(ClassLen,entry, ".")
                   IF Temp1 AND Temp1<RetVal THEN
                     ClassLen=Temp1+1
                   ELSE
                     Temp1=INSTR(ClassLen,entry, ANY " ,+;:")
                     IF Temp1 AND Temp1<RetVal THEN ClassLen=Temp1-1
                     EXIT DO
                   END IF
                 LOOP
                 EXIT DO
               END IF
             LOOP
             IF ClassLen>BufLen THEN
               REGEXPR " [%\-/\q=\^]" IN entry AT BufLen TO ClassLen
               IF ClassLen AND ClassLen<RetVal THEN RetVal=ClassLen
               ClassLen=INSTR(BufLen, entry, ",")
             END IF
             IF ClassLen AND ClassLen<RetVal THEN RetVal=ClassLen
           END IF
           fault=0
           IF RetVal>BufLen+3 THEN
             fileref=RTRIM$(MID$(entry,BufLen,RetVal-BufLen),"\")
             fault=DIR$(fileref,23)=""
             IF fault THEN
               IF cBack THEN
                 COLOR 15,1-cBack
                 PRINT entry
               END IF
               COLOR 14,4  'Yellow on Red means path\file not found
             ELSE
               COLOR 14,1-cBack  'Yellow on Blue just marks where a path\file reference is
             END IF
             PRINT fileref;SPACE$(SCREENX-CURSORX);
             COLOR 15,1-cBack
             PRINT
           END IF
           IF fault THEN
             FOR Temp1=ASC("C") TO ASC("Z")
               MID$(fileref,1)=CHR$(Temp1)
               IF DIR$(fileref,23)>"" THEN
                 COLOR 14,2   'Yellow on Green means file found, different drive
                 PRINT fileref;
                 PRINT TAB(64)USING$("###,###,###,###  ",GetSizeOfFile((fileref),dtg))dtg;
                 COLOR 15,1-cBack
                 PRINT
               END IF
             NEXT
             IF pick<>$ESC THEN pick=WAITKEY$
             SELECT CASE pick
             CASE $TAB
               pause=NOT pause
             CASE $CR
               cBack=1-cBack
             CASE $ESC
               EXIT FUNCTION
             END SELECT
           ELSE
             ' SLEEP 200
           END IF
           BufLen=RetVal
         LOOP
         entry=""
       END IF
     END IF
     DO
       IF pick<>$ESC THEN pick=INKEY$
       SELECT CASE pick
       CASE $TAB
         pause=NOT pause
       CASE $CR
         cBack=1-cBack
       CASE $ESC
         EXIT FUNCTION
       END SELECT
     LOOP WHILE pause
    END FUNCTION
    '______________________________________________________________________________
    
    FUNCTION PBMAIN
     LOCAL zStartHere AS ASCIIZ * 256
     LOCAL HKey AS LONG, NKey AS INTEGER, KeyName AS STRING,label AS STRING
     COLOR 15,1
     CONSOLE SCREEN 45,100
     CLS
     CONSOLE NAME "Registry walk - Please wait..."
     FOR NKey = 1 TO 9
       pick=""
       SELECT CASE NKey
       CASE 1
         HKey=%HKEY_CLASSES_ROOT
         KeyName="HKEY_CLASSES_ROOT"
       CASE 2
         HKey=%HKEY_CURRENT_USER
         KeyName="HKEY_CURRENT_USER"
       CASE 3
         HKey=%HKEY_LOCAL_MACHINE
         KeyName="HKEY_LOCAL_MACHINE"
       CASE 4
         HKey=%HKEY_USERS
         KeyName="HKEY_USERS"
       CASE 5
         HKEY=%HKEY_PERFORMANCE_DATA
         KeyName="HKEY_PERFORMANCE_DATA"
       CASE 6
         HKey=%HKEY_PERFORMANCE_TEXT
         KeyName="HKEY_PERFORMANCE_TEXT"
       CASE 7
         HKey=%HKEY_PERFORMANCE_NLSTEXT
         KeyName="HKEY_PERFORMANCE_NLSTEXT"
       CASE 8
         HKey=%HKEY_CURRENT_CONFIG
         KeyName="HKEY_CURRENT_CONFIG"
       CASE 9
         HKey=%HKEY_DYN_DATA
         KeyName="HKEY_DYN_DATA"
       END SELECT
       label=STRING$(SCREENX, "-")
       MID$(label,(LEN(label)-LEN(KeyName))\2)=KeyName
       PRINT LEFT$(label,LEN(label)-1)
       zStartHere = ""                                 'Change to your need
       CONSOLE NAME "Registry Walk & Check of Path References - " & KeyName
       PRINT "zStartHere = " zStartHere
       entry=""
       EnumKey HKey, zStartHere
     NEXT
     PRINT
     PRINT "Press any key or click to continue..."
     MOUSE ON
     MOUSE 3, UP
    END FUNCTION
Working...
X