Maximum filename length in NTFS (Windows XP and Windows Vista)?

前端 未结 14 1821
再見小時候
再見小時候 2020-11-22 14:46

I\'m designing a database table which will hold filenames of uploaded files. What is the maximum length of a filename in NTFS as used by Windows XP or Vista?

14条回答
  •  旧时难觅i
    2020-11-22 15:40

    238! I checked it under Win7 32 bit with the following bat script:

    set "fname="
    for /l %%i in (1, 1, 27) do @call :setname
    @echo %fname%
    for /l %%i in (1, 1, 100) do @call :check
    goto :EOF
    :setname
    set "fname=%fname%_123456789"
    goto :EOF
    :check
    set "fname=%fname:~0,-1%"
    @echo xx>%fname%
    if not exist %fname% goto :eof
    dir /b
    pause
    goto :EOF
    

提交回复
热议问题