HurleyShanabarger Posted March 1, 2022 Posted March 1, 2022 Hello, I am using a function to retrieve the filepath case correct. This is working without problems, if the path is located in my @HomeDrive. If the path is on another drive, it fails. My _PathCaseSensitive function is using FileGetShortName and this seems to be the culprit. #Region Main _Check("C:\_A ab\_SomeNameForSomeFolder") ; works for me _Check("D:\_B bb\_SomeNameForSomeFolder") _Check("Y:\_B bb\_SomeNameForSomeFolder") #EndRegion Main #Region Functions Func _Check($p_sgPath) ; Create DirCreate($p_sgPath) ; Short name Local $l_sgPath = FileGetShortName($p_sgPath) ConsoleWrite("ToCreate: " & $p_sgPath & @CRLF) ConsoleWrite("Lower: " & $l_sgPath & @CRLF) ConsoleWrite("Exists: " & FileExists($l_sgPath) & @CRLF) ConsoleWrite("Correct: " & String($p_sgPath <> $l_sgPath) & @CRLF) ConsoleWrite(@CRLF) EndFunc ;==>_Check #EndRegion Functions Both, D:\ and Y:\ are partition of the same HDD than C:\. Just for more context, this is the function I use retrieve the filepath case correct: #Region Function Func _PathCaseSensitive($p_sgPath) If Not FileExists($p_sgPath) Then Return SetError(0x01, 0, $p_sgPath) ; Get shortname, convert lower case and then get long name $p_sgPath = FileGetLongName(StringLower(FileGetShortName($p_sgPath))) ; Replace drive letter with uppercase version $p_sgPath = Execute('"' & StringRegExpReplace($p_sgPath, "^(\w):", '" & StringUpper("$1:") & "') & '"') Return $p_sgPath EndFunc ;==>_PathCaseSensitive #EndRegion Functions
ad777 Posted March 1, 2022 Posted March 1, 2022 @HurleyShanabarger check Properties of _B bb folderAnd _B bb Folder that located at: _Check("D:\_B bb\_SomeNameForSomeFolder") _Check("Y:\_B bb\_SomeNameForSomeFolder By Going into -> D:\_B bb folder or Y:\_B bb folder -> Right Click on Folder _B bb -> Security Tab -> Make sure that Allow Read & Full Control. none
HurleyShanabarger Posted March 2, 2022 Author Posted March 2, 2022 Thanks for the hint, but that was not it. Using fsutil, I see that the 8.3 name creation is disabled on the other drives: fsutil 8dot3name query Y: The volume state is: 1 (8dot3 name creation is disabled). The registry state is: 2 (Per volume setting - the default). Based on the above settings, 8dot3 name creation is disabled on Y: Maybe this is worth mentioning in the helpfile? Now I am back to square one: How can I convert any given path into the case correct form?
Nine Posted March 2, 2022 Posted March 2, 2022 see : https://superuser.com/questions/1505174/how-comes-that-short-filenames-8-3-are-created-in-one-partition-and-not-in-ano “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
HurleyShanabarger Posted March 2, 2022 Author Posted March 2, 2022 Thanks, I saw that whil checking with fsutil.exe. I thin I found a solution in the meantime using FileFindFirstFile.
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