locked
Characters in file and folder name

    Question

  • Hi, which characters should avoid to use in file and folders name. Eg. . , + % etc. Please guide asap.
    Friday, January 6, 2017 9:32 AM

All replies

  • Please refer to:
    Naming Files, Paths, and Namespaces
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

    Friday, January 6, 2017 10:08 AM
  • I am not getting clarity by your reference url. I just want to know which characters are not allowed to use in files and folders name.
    Friday, January 6, 2017 10:58 AM
  • You cannot use "reserved characters" in file or folder name.

    # I'm afraid you misunderstand what "reserved" means.
       It means "system reserves" them, so they are not allowed to use. 
    • Edited by Ashidacchi Friday, January 6, 2017 11:09 AM
    Friday, January 6, 2017 11:05 AM
  • You can find them by code, with the IItemNameLimits interface.

    For example, on NTFS, C/C++ test =>

    pszInvalidCharacters variable will contain : \/:*?"<>|

    HRESULT hr = E_FAIL; IShellFolder* psfDesktop; hr = SHGetDesktopFolder(&psfDesktop); if (SUCCEEDED(hr)) { IItemNameLimits *pinl; hr = psfDesktop->QueryInterface(IID_PPV_ARGS(&pinl)); if (SUCCEEDED(hr)) { LPWSTR pszValidCharacters; LPWSTR pszInvalidCharacters; hr = pinl->GetValidCharacters(&pszValidCharacters, &pszInvalidCharacters); } }



    • Edited by Castorix31 Friday, January 6, 2017 11:59 AM
    Friday, January 6, 2017 11:59 AM
  • Off-topic for this forum.

    Danny

    Wednesday, January 11, 2017 1:13 PM
    Moderator