udfIsDisabledNtfs8dot3Name
bln udfIsDisabledNtfs8dot3Name ()
;------------------------------------------------------------------------------------------------------------------------------------------
#DefineFunction udfIsDisabledNtfs8dot3Name ()
If RegExistValue (@REGMACHINE, "System\CurrentControlSet\Control\FileSystem[NtfsDisable8dot3NameCreation]") Then Return !!Int (RegQueryDword (@REGMACHINE, "System\CurrentControlSet\Control\FileSystem[NtfsDisable8dot3NameCreation]"))
Return @FALSE
;..........................................................................................................................................
; This UDF "udfIsDisabledNtfs8dot3Name" does what it should do.
;
; (c)Detlev Dalitz.20100210.
;..........................................................................................................................................
#EndFunction
;------------------------------------------------------------------------------------------------------------------------------------------

; Test.

blnIsDisabledNtfs8dot3Name = udfIsDisabledNtfs8dot3Name ()

strMsgTitle = "Status of NtfsDisable8dot3NameCreation"
strMsgText = "NtfsDisable8dot3NameCreation is " : ItemExtract (1 + blnIsDisabledNtfs8dot3Name, "disabled.,enabled.", ",")
Message (strMsgTitle, strMsgText)

Exit
;------------------------------------------------------------------------------------------------------------------------------------------
;   Topic:  FileNameShort Warning
;   Conf:  WinBatch
;   From:  ferchl les.ferch@jpmchase.com
;   Date:  Wednesday, January 10, 2007 11:07 AM
;
;   I had a script fail on a machine today that worked on all other machines. When I traced the code, I
;   found that it was failing where a file name was passed to another program as a parameter and that
;   name was long and contained spaces but was not quoted. However, I had used FileNameShort in the
;   program to avoid this issue.
;
;   Well, it turns out that short filename creation was turned off on the machine in question
;   (presumably to improve performance). So, I have recoded the program to use quotes where necessary
;   around long filenames instead of using FileNameShort.
;
;   I just thought I'd post this as a warning for anyone relying on FileNameShort in their code.
;   Perhaps a note could be added to the documentation warning that this function may return the long
;   name if short filename creation is disabled. That is, if the following registry value is set to 1:
;
;   HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation
;
;   Note: If you change this value to 1, any newly created files and folder will not have a short name,
;   but all existing files and folders will retain their short names.
;------------------------------------------------------------------------------------------------------------------------------------------