Thanks, works fine
I have changed the code in the top level post to a cleaner version (sorry tuska).
I will also change the describtion of how to define the Auto switch dir
so it allows the Auto-switch to the dir of the DestinationFile definition.
Moderators: Hacker, petermad, Stefan2, white
Thanks, works fine
Code: Select all
;........................................................... >> Thanks to Horst.Epp & Ovg! << .....................................
;https://www.ghisler.ch/board/viewtopic.php?t=75439 ........ Open Everything GUI results with TC LOADLIST
;https://www.ghisler.ch/board/viewtopic.php?t=75417 ........ LOADLIST command and UTF8 file lists
;https://www.voidtools.com/forum/viewtopic.php?f=4&t=10594 . Send ResultsList to Total Commander
;https://ghisler.ch/board/viewtopic.php?p=406266#p406266 ... Description of PARAMETERS and how to change the AHK-INI FILE
;https://www.ghisler.ch/board/viewtopic.php?p=406296#p406296 ADDENDSLASH=; Everything: FOLDER_APPEND_PATH_SEPARATOR=
;https://ghisler.ch/board/viewtopic.php?p=406336#p406336 ... ATTRIBUTES (File Attribute Constants, File Access Rights Constants)
;https://www.quickaccesspopup.com/tag/shortcuts/ ........... Quick Access Popup (QAP) Hotkeys;
; System-wide Hotkeys for Everything instances ...... https://www.ghisler.ch/board/viewtopic.php?p=406233#p406233
;**********************************************************************************************************************************
; The contents of lines which are underlined with '*'-asterisk are to be adjusted if necessary, e.g. path and parameter adjustments.
; For changes, e.g. path or parameter changes, the following lines are to be considered: 48, 57, 59, 61, 63, 73, 75, 175, 178 (!).
;**********************************************************************************************************************************
; TC: cm_SwitchHidSys -> Everything shows hidden files automatically, in TC hidden files must first be shown with this command.
; TC: cm_SwitchIgnoreList -> Disable ignore list otherwise files/folders that are in the ignore list appear in the error message!
; TC: cm_ToggleAutoViewModeSwitch --> [x] Automatically switch 'View mode' on directory change --> required!
;
; EV-Results.txt - RegEx queries (thanks to Ovg!)
; 1. Lines where N: is present at the beginning, e.g. ...... (?i)^N:.*$
; 2. Lines that do NOT have N: at the beginning, e.g. ...... (?i)^[^N]:.*$
; 3. Lines that have a backslash at the end ................ ^.*\\$
; 4. Lines that do NOT have a backslash at the end ......... ^.*[^\\]$
;
; -> Notepad++ | EV-Results.txt -> Edit with Notepad++ ...
; -> Search -> Find... Ctrl+F -> Find what : (e.g.) -> (?i)^N:.*$ -> x Regular expression -> Count -> Search result in status bar
; -- EmEditor | Field: Filter | [x] Use Regular Expressions | Incremental Search | Ctrl+A in Search result: result in status bar
;
;==================================================================================================================================
; Build AutoHotkey_L
; Build x64
; Build Kill=true
; Build Zip=false
; Build Run=true
#NoEnv
;#Persistent
#SingleInstance Force
SetBatchLines, -1
; Create / read .ini file settings
SetTitleMatchMode, RegEx
iniFile := RegExReplace(A_ScriptFullPath, "(ahk|exe)$", "ini")
if not (FileExist(iniFile)) {
iniContent :="
(( LTrim
[General]
; Where to save the output (full path)
DestinationFile = D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\EV-Results\EV-Results.txt
; ************************************************************************************
; The columns 'Name' and 'Path' must be visible in the Everything
; window. The first value is the position of the 'Path', the second
; value is the position of the 'Name' column
; Default: 2,1
;====================================================================================================
EverythingColumnPositions=2,1
;*****************************
AddEndSlash = 1
;***************
Everything = C:\Tools\Everything\Everything64.exe
; ************************************
TotalCmd = D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\TOTALCMD64.EXE
; *************************************************************************
)"
FileAppend, % iniContent, % iniFile, UTF-16
}
IniRead, DestinationFile, % iniFile, General, DestinationFile, %A_Space%
IniRead, EverythingColumnPositions, % iniFile, General, EverythingColumnPositions, 2`,1
IniRead, AddEndSlash, % iniFile, General, AddEndSlash, 1
IniRead, Everything, % iniFile, General, Everything, "C:\Tools\Everything\Everything64.exe"
; **************************************
IniRead, TotalCmd, % iniFile, General, TotalCmd,"D:\Daten\Programme\TotalCommander\TCD_USB-Stick\TC32-64USB\TOTALCMD64.EXE"
; ***************************************************************************
DestinationFile := ResolveEnvVars(DestinationFile)
EverythingColumnPositions := StrReplace(EverythingColumnPositions, " ")
; Force default value if none is given (or path doesn't exist)
SplitPath, DestinationFile, , dstPath
if (DestinationFile = "" || !InStr(FileExist(dstPath), "D")) {
Msgbox, 16, Fatal error, Destination file definition is missing or illegal named !
Return
}
if (EverythingColumnPositions = "" || !InStr(EverythingColumnPositions, ",")) {
EverythingColumnPositions := "2,1"
}
columnArray := StrSplit(EverythingColumnPositions, ",")
hWnd := WinExist("ahk_exe Everything(?:\d\d)*\.exe")
if hWnd
{
ControlGet, winContent, List, , SysListView321, % "ahk_id" hWnd
if (winContent)
{
fullContent := ""
; Loop over row(s)
Loop, Parse, winContent, `n
{
rowID := A_Index
path := ""
name := ""
full := ""
Bad := 2
; Loop over column(s)
Loop, Parse, A_LoopField, % A_Tab
{
colID := A_Index
content := A_LoopField
If (colID > columnArray[1] And colID > columnArray[2])
{
Break
}
Else
{
If (colID = columnArray[1])
{
If !RegExMatch(content,"i)^[a-z]:")
{
Break
}
path := content
Bad -= 1
If !RegExMatch(path,"\\$")
{
path := path . "\"
}
}
Else if (colID = columnArray[2])
{
If content is Space
{
Break
}
name := content
Bad -= 1
}
}
}
If (Bad == 0)
{
full := path . name
If InStr(FileExist(full), "D")
{
if (AddEndSlash == 1)
{
if !RegExMatch(full,"\\$")
{
full := full . "\"
}
}
Else
{
If RegExMatch(full,"\\$")
{
full := SubStr(full,1,StrLen(full)-1)
}
}
}
fullContent .= full "`n"
}
}
fullContent := RegExReplace(fullContent,"\R$","")
If (FileExist(DestinationFile))
FileDelete, % DestinationFile
FileAppend, % fullContent, % DestinationFile, UTF-16
;==============================================================================================================================================================
DestinationDir := SubStr(DestinationFile,1,InStr(DestinationFile, "\",,-1))
Run %TotalCmd% /O /T /S %DestinationDir%
; ********
run %everything% -instance "PRIVATE" -close
; *******
; run %everything% -close
}
Else
; Empty search result
{
Msgbox, 16,, Search result is Empty, Nothing to do ...
}
; No Everything window visible
} Else {
Msgbox, 16, Fatal error, Everything window does not exist!
}
SetTitleMatchMode, 1
return
; ==================================
; = GOTO: FUNCTIONS - ResolveEnvVars
; ==================================
; http://www.autohotkey.com/board/topic/40115-func-envvars-replace-environment-variables-in-text/#entry310601
ResolveEnvVars(str) {
if sz := DllCall("ExpandEnvironmentStrings", "uint", &str, "uint", 0, "uint", 0)
{
VarSetCapacity(dst, A_IsUnicode ? sz * 2 : sz)
if DllCall("ExpandEnvironmentStrings", "uint", &str, "str", dst, "uint", sz)
return dst
}
return str
}
I will not copy this into the top level post.
It could additionally be called "Tuskas private version for Ovg".
Yes, I know, I tested it (and made a picture)Ovg wrote: 2021-10-18, 19:40 UTC 2tuska
... Everything doesn't know anything about TC's ignore list and find all files according your search, but TC can't find
some of them because ignore list.![]()
![]()
Code: Select all
18.10.2021 Test results | Search result obtained in approx. 15 minutes.
--------------------------------------------------------------------------------------------------------------------------------
Drive N: TC Everything Difference TC TC-Difference TC-Difference
EV-Results.txt 1.5.0.1280a-x64 (TXT* <-> EV) 10.00-x64 (EV -> TC)
--------------------------------------------------------------------------------------------------------------------------------
Total 135379 (1) 25,1 MB 135380 1 (1) 135180 200- See: Differences (1), (2), (3)
Folder 12545 (1) ^.*\\$ 12546 1 (1) 12532 (2) 14- (1),(2) See: Differences (2)
Files 122834 ^.*[^\\]$ 122834 0 122648 186- See: Differences (3)
--------------------------------------------------------------------------------------------------------------------------------
Files not found ................................... 199
Error message: "File not found!" (199x) desktop.ini
Everything: n: desktop.ini ........................ 81 < * TXT: EV-Results.txt >
Code: Select all
(1) Difference: 1
- Everything counts with search query: N: ........ N:\ as value 1, while ...
- Total Commander for understandable reasons ..... N:\ does NOT count this value because it is not a folder or a file.
*** EDIT - Solution: ****************************************************************************************************
Everything -> Search for -> N:\ (Backslash!) -> https://www.voidtools.com/forum/viewtopic.php?p=40528#p40528
then the drive letter itself is no longer displayed in the search result (and is NOT counted)!
*************************************************************************************************************************
(2) 1 Difference: Folder ( 1): See point (1)
Difference: Folder (13): ...
2 N:\System Volume Information\AadRecoveryPasswordDelete\
3 N:\System Volume Information\Chkdsk\
4 N:\System Volume Information\ClientRecoveryPasswordRotation\
5 N:\System Volume Information\EDP\
6 N:\System Volume Information\EDP\Recovery\
7 N:\System Volume Information\EfaSIDat\
8 N:\System Volume Information\SPP\
9 N:\System Volume Information\SPP\OnlineMetadataCache\
10 N:\WindowsImageBackup\tuska-PC\ .......................... (Everything: 156 objects)
11 N:\WindowsImageBackup\tuska-PC\Backup 2016-02-01 113112\
------------------------------------------------------------------------------------------------------------
12 N:\WindowsImageBackup\tuska-PC\Catalog\ .................. (Everything: 2 objects)
- attribute:a N:\WindowsImageBackup\tuska-PC\Catalog\ .... (Everything: 2 objects) -> attribute:a ?? ***)
- attribute:i N:\WindowsImageBackup\tuska-PC\Catalog\ .... (Everything: 2 objects) -> attribute:i ??
- attribute:ia N:\WindowsImageBackup\tuska-PC\Catalog\ ... (Everything: 2 objects) -> attribute:ia ??
------------------------------------------------------------------------------------------------------------
13 N:\WindowsImageBackup\tuska-PC\Logs\ ..................... (Everything: 27 objects)
14 N:\WindowsImageBackup\tuska-PC\SPPMetadataCache\ ......... (Everything: 108 objects)
==
***) Due to too much effort, I did not check every folder or file (below) for attributes.
(3) I have determined the difference of 186 files. In principle, these are the following files:
N:\$RECYCLE.BIN\S-1-5-18\desktop.ini
N:\$RECYCLE.BIN\S-1-5-21-2139236618-1214191708-2897600188-1001\desktop.ini
...
N:\System Volume Information\{2679ab8a-941f-11e5-9bd3-bc5ff4d99377}{3808876b-c176-4e48-b7ae-04046e6cc752}
N:\System Volume Information\Chkdsk\Chkdsk20131125164037.log
N:\System Volume Information\FVE2.{24e6f0ae-6a00-4f73-984b-75ce9942852d}
...
N:\WindowsImageBackup\...
...
Code: Select all
(0) ATTRIBUTES .................: General overview of (1)-(3)
(1) Attributes .................: https://www.voidtools.com/forum/viewtopic.php?f=12&t=10176#attrib
(2) File Attribute Constants ...: https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants
(3) File Access Rights Constants: https://docs.microsoft.com/en-us/windows/win32/fileio/file-access-rights-constants
(X) Hint .......................: cm_SwitchHidSys | Turn hidden/system files ON(!) [and off]
==============================================================================================================================
Value Constant EV-Search: Objects |Total in TC |Files |Folders |Diff.
==============================================================================================================================
(1) --------------------------------------------------------------------------------------------------------------------------
(1) R Read Only attribute:r 830
(2) 1 (0x1) FILE_ATTRIBUTE_READONLY attribute:0x1
(1) --------------------------------------------------------------------------------------------------------------------------
(1) H Hidden attribute:h 3043
(2) 2 (0x2) FILE_ATTRIBUTE_HIDDEN attribute:0x2
--------------------------------------------------------------------------------------------------------------------------
(1) S System attribute:s 769
(2) 4 (0x4) FILE_ATTRIBUTE_SYSTEM attribute:0x4
--------------------------------------------------------------------------------------------------------------------------
(1) D Directory attribute:d 12546
(2) 16 (0x10) FILE_ATTRIBUTE_DIRECTORY attribute:0x10
(3) 16 (0x10) FILE_WRITE_EA attribute:0x10
--------------------------------------------------------------------------------------------------------------------------
(1) A Archive attribute:a 121058
(2) 32 (0x20) FILE_ATTRIBUTE_ARCHIVE attribute:0x20
(3) 32 (0x20) FILE_EXECUTE attribute:0x20
(3) 32 (0x20) FILE_TRAVERSE attribute:0x20
--------------------------------------------------------------------------------------------------------------------------
(1) V Integrity Stream attribute:v 0
(1) X No Scrub Data attribute:x 0
--------------------------------------------------------------------------------------------------------------------------
(1) N Normal attribute:n
(2) 128 (0x80) FILE_ATTRIBUTE_NORMAL attribute:0x80
(3) 128 (0x80) FILE_READ_ATTRIBUTES attribute:0x80
--------------------------------------------------------------------------------------------------------------------------
(1) T Temporary attribute:t 7 7 0 0
(2) 256 (0x100) FILE_ATTRIBUTE_TEMPORARY attribute:0x100 *.tmp, .* (OneDrive)
(3) 256 (0x100) FILE_WRITE_ATTRIBUTES attribute:0x100
--------------------------------------------------------------------------------------------------------------------------
(1) L Reparse Point attribute:l 0
(2) 1024 (0x400) FILE_ATTRIBUTE_REPARSE_POINT attribute:0x400
--------------------------------------------------------------------------------------------------------------------------
(1) C Compressed attribute:c 0
(2) 2048 (0x800) FILE_ATTRIBUTE_COMPRESSED attribute:0x800
--------------------------------------------------------------------------------------------------------------------------
(1) O Offline attribute:O 0
(2) 4096 (0x1000) FILE_ATTRIBUTE_OFFLINE attribute:0x1000
--------------------------------------------------------------------------------------------------------------------------
(1) I Not Content Indexed attribute:i 2079
(2) 8192 (0x2000) FILE_ATTRIBUTE_NOT_CONTENT_INDEXED attribute:0x2000 2079
--------------------------------------------------------------------------------------------------------------------------
(1) E Encrypted attribute:e 0
(2) 16384 (0x4000) FILE_ATTRIBUTE_ENCRYPTED attribute:0x4000
--------------------------------------------------------------------------------------------------------------------------
(1) U Unpinned attribute:u 0
(1) P Pinned attribute:p 15 15 0 0
- attribute:p Mediainfo*.dll
--------------------------------------------------------------------------------------------------------------------------
(1) M Recall on Data Acces attribute:m 0
(2) 4194304 (0x400000) FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS attribute:0x400000
--------------------------------------------------------------------------------------------------------------------------
(2) 64 (0x40) FILE_ATTRIBUTE_DEVICE attribute:0x40 0
(3) 64 (0x40) FILE_DELETE_CHILD attribute:0x40 0
--------------------------------------------------------------------------------------------------------------------------
(2) 32768 (0x8000) FILE_ATTRIBUTE_INTEGRITY_STREAM attribute:0x8000 0
(2) 131072 (0x20000) FILE_ATTRIBUTE_NO_SCRUB_DATA attribute:0x20000 0
(2) 262144 (0x40000) FILE_ATTRIBUTE_RECALL_ON_OPEN attribute:0x40000 4
(2) 512 (0x200) FILE_ATTRIBUTE_SPARSE_FILE attribute:0x200 1 1 0 0
- attribute:0x200 N:\System Volume Information\MasterFileStatus.db
(2) 65536 (0x10000) FILE_ATTRIBUTE_VIRTUAL attribute:0x10000 0
==============================================================================================================================
Code: Select all
Solution:
Everything -> Search for -> N:\ (Backslash!) -> https://www.voidtools.com/forum/viewtopic.php?p=40528#p40528
then the drive letter itself is no longer displayed in the search result (and is NOT counted)!
Code: Select all
c:\
d:\
e:\
n:\ and so on
This error message is from TC, not from script ... Please read my post above.tuska wrote: 2021-10-19, 05:32 UTC A file "C:\Users\<User>\AppData\Local\Temp\tc\EV-Results_ERROR.txt" would be good.
If the script detects that e.g. 199 objects are missing (13 folders and 186 files), does it know the paths to them?
A quick look at such a file would certainly reassure me a lot.
I'm sorry, I forgot.Ovg wrote: 2021-10-19, 05:47 UTCThis error message is from TC, not from script ... Please read my post above.tuska wrote: 2021-10-19, 05:32 UTC A file "C:\Users\<User>\AppData\Local\Temp\tc\EV-Results_ERROR.txt" would be good.
If the script detects that e.g. 199 objects are missing (13 folders and 186 files), does it know the paths to them?
A quick look at such a file would certainly reassure me a lot.
Code: Select all
LOADLIST <filename> Load complete list (like search result) from file
Code: Select all
|----------------------------------------------------------|
| <Fehler!> |
|----------------------------------------------------------|
| ? Datei nicht gefunden! (199x) |
| desktop.ini |
| desktop.ini |
| desktop.ini |
| desktop.ini |
| desktop.ini |
| ... |------| |
| | OK | |
| |------| |
|----------------------------------------------------------|
Code: Select all
|----------------------------------------------------------|
| <ERROR!> |
|----------------------------------------------------------|
| ? Objects not found: 199 |
| - Folder ........: 13 |
| - Files .........: 186 |
| |
| File created in %TEMP%\_tc\ |
| _YYYY-MM-DD_HH:MM:SS_LOADLIST_error.txt |
| |------| |
| | OK | |
| |------| |
|----------------------------------------------------------|
I am pleased that you have found a solution.Horst.Epp wrote: 2021-10-19, 08:05 UTC Updated the first post.
I have added an option to close the Everything window or not.
Default is set to close.