WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: RAK on December 24, 2013, 02:45:12 AM

Title: corrupt folders?
Post by: RAK on December 24, 2013, 02:45:12 AM
When searching for files in User directories
fileName = 'file.txt'
handle=srchInit("c:\users|", fileName ,"","",16)
filePathName=srchNext(handle)

It is returning the following string where the file does not exist. I think it's returned due to an error as the path is too long for windows. It seems have been created by adobe? I did read that the 'Application Data' folder is actually redirected to 'appData'. I can go to this folder if I paste it in a folder path - but cannot go back to delete the structure. Any Ideas on what I could do? I want to complete the development of this WB script and cannot on my machine due to this returned path.. Sure is Strange.. 

C:\Users\Roy Kaplan\AppData\Roaming\SoftSell\WindMan\Data\Launch\DeskTops\IE2.dtf"   50,100,550,500,2|Untitled - Notepad|"notepad.exe"|"C:\Users\All Users\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Adobe\CameraRaw\CameraProfiles\Camera\Canon EOS 10"
Title: Re: corrupt folders?
Post by: snowsnowsnow on December 24, 2013, 04:13:54 AM
Gee...

I was sure this thread was going to be about origami experts taking bribes.
Title: Re: corrupt folders?
Post by: kdmoyers on December 24, 2013, 07:13:20 AM
Quote from: snowsnowsnow on December 24, 2013, 04:13:54 AMI was sure this thread was going to be about origami experts taking bribes.
Unlikely. The origami yakusa are merciless; to openly discuss their criminal activities is to invite assassination. Why, I heard about a guy who.. URK.... ahh.... (thump)
Title: Re: corrupt folders?
Post by: snowsnowsnow on December 24, 2013, 08:29:33 AM
Quote from: kdmoyers on December 24, 2013, 07:13:20 AM
Quote from: snowsnowsnow on December 24, 2013, 04:13:54 AMI was sure this thread was going to be about origami experts taking bribes.
Unlikely. The origami yakusa are merciless; to openly discuss their criminal activities is to invite assassination. Why, I heard about a guy who.. URK.... ahh.... (thump)

Good point.  I'll promise to be careful.
Title: Re: corrupt folders?
Post by: Deana on December 24, 2013, 09:41:28 AM
Quote from: RAK on December 24, 2013, 02:45:12 AM
When searching for files in User directories
fileName = 'file.txt'
handle=srchInit("c:\users|", fileName ,"","",16)
filePathName=srchNext(handle)

It is returning the following string where the file does not exist. I think it's returned due to an error as the path is too long for windows. It seems have been created by adobe? I did read that the 'Application Data' folder is actually redirected to 'appData'. I can go to this folder if I paste it in a folder path - but cannot go back to delete the structure. Any Ideas on what I could do? I want to complete the development of this WB script and cannot on my machine due to this returned path.. Sure is Strange.. 

C:\Users\Roy Kaplan\AppData\Roaming\SoftSell\WindMan\Data\Launch\DeskTops\IE2.dtf"   50,100,550,500,2|Untitled - Notepad|"notepad.exe"|"C:\Users\All Users\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Adobe\CameraRaw\CameraProfiles\Camera\Canon EOS 10"

I suspect that you are dealing with a reparse point. Starting in File and Folder Finder Extender: Version 44005 Aug. 28, 2013, we added support for a new flag value of 128 (no reparse points) to the fafOpen function's flags parameter.  When set this flag prevents the extender from  including file system objects implemented with reparse points in searches performed using the returned search context. Reparse points are used by the  NTFS file system to implement symbolic links, directory junctions and directory mount points among other things. Reparse points, and their associated  filters and applications provided by 3rd party vendor may also be present on a system.

Also to specify an extended-length path, a maximum path of 32,767 characters, use the "\\?\" prefix. The "\\?\" prefix to a path string tells this function to disable all string parsing and to send the string that follows it straight to the file system. For example, if the file system supports large paths and file names, you can exceed the MAX_PATH (260) limits that are otherwise enforced.  For example,  "\\?\D:\very long path" *or* "\\?\UNC\server\share".

The code might look something like this:

Code (winbatch) Select
;Load Appropriate Extender
AddExtender( "WWFAF44I.DLL", 44005, "WWFAF64I.DLL" )
outfile =  Dirscript():'output.txt'
username = Environment('USERNAME')

; Initialize flags for readability
fHidden = 1      ; Include hidden files
fSystem = 2      ; Include system files
fFolders = 4     ; Inspect  subfolder names also
fFindFolders = 8 ; Only inspect subfolder names not file names
fRecurse = 16    ; Recurse through subfolders
fNoPathInfo = 32 ; Do not return path information to files or folders found
fNoRedirect = 64 ; Do not turn off file redirection for x64 windows
fNoReparse = 128 ; Ignore reparse points. Prevents the extender from including file system objects implemented with reparse points in searches performed using the returned search context.

; Open a search handle
fhandle = fafOpen( "\\?\c:\users\":username, "*", fRecurse|fNoReparse )
filelist = ''
; Perform the search
While @TRUE
   sFound = fafFind( fHandle )
   If sFound == '' Then Break
   If filelist=='' then filelist = sFound
   Else filelist = filelist:@crlf:sFound
EndWhile
; Close the search handle
fafClose( fHandle )
FilePut( outfile, filelist )
Run( outfile, '')

Exit





Title: Re: corrupt folders?
Post by: RAK on December 24, 2013, 02:52:23 PM
Hi Deana,
Sounds like you nailed the issue. I am using wsrch34i.. I will recode to use the new search dll and use the 128 flag.. I was able do get it coded by specifying a specific user directory for testing. I will recode to prevent similar issues on other machines.

could you explain a little about 'newer' extender function: AddExtender( "WWFAF44I.DLL", 44005, "WWFAF64I.DLL" )?
what is the '44005' for and please confirm that the 64 bit dll function is embedded in the the 44 dll file.

Thanks for your help - you are awesome..
Roy
Title: Re: corrupt folders?
Post by: RAK on December 24, 2013, 03:11:38 PM
could you explain the use of  "\\?\c:\users\"  ?

thanks
Title: Re: corrupt folders?
Post by: Deana on December 26, 2013, 09:12:43 AM
Quote from: RAK on December 24, 2013, 02:52:23 PM
Hi Deana,
Sounds like you nailed the issue. I am using wsrch34i.. I will recode to use the new search dll and use the 128 flag.. I was able do get it coded by specifying a specific user directory for testing. I will recode to prevent similar issues on other machines.

could you explain a little about 'newer' extender function: AddExtender( "WWFAF44I.DLL", 44005, "WWFAF64I.DLL" )?
what is the '44005' for and please confirm that the 64 bit dll function is embedded in the the 44 dll file.

Thanks for your help - you are awesome..
Roy

The File and Folder Finder extender is a streamlined version of the original File Search extender that emphasizes speedy searches for files and folder on local drives and network shares.  The File and Folder Finder extender can be used to:



The File and Folder Finder extender cannotââ,¬Â¦


Note: To help make the File and Folder Finder extender searches faster, its use is restricted to Microsoft Windows 2000 or newer.  This applies to both the client and server versions of the operating system.  The original File Search extender can still be used on older versions of Microsoft Windows.




The AddExtender function now accepts 3 possible parameters. The second and third parameters are optional.

QuoteSyntax:
AddExtender(filename [,version [,alternatefilename]]

Parameters:
(s) filename:  WIL extender Dll filename

(s) extender version: [optional] minimum required extender version number.

(s) alternate filename:  [optional] 64-bit WIL extender Dll filename. Note that 64-bit WinBatch still treats the first parameter as the file name of a 64-bit extender when no third parameter is present.





The 44005 indicates the minimum required extender version number.

The file and folder extender included two separate dlls: 32-bit dll WWFAF44I.DLL and a 64-bit dll named WWFAF64I.DLL