Convert long filename to short filename (8.3) using cmd.exe
cmd /c for %A in (“C:\Documents and Settings\User\NTUSER.DAT”) do @echo %~sA
cmd /c for %A in (“C:\Documents and Settings\User\NTUSER.DAT”) do @echo %~sA
The issue will be always present in Windows, to keep compatibility with old software. Use the NT-style name syntax “\\?\D:\very long path” to workaround this issue. In Windows 10 (Version 1607 – Anniversary Update) and Windows Server 2016 you seem to have an option to ignore the MAX_PATH issue by overriding a group policy entry … Read more
You can’t add items to an array, since it has fixed length. What you’re looking for is a List<string>, which can later be turned to an array using list.ToArray(), e.g. List<string> list = new List<string>(); list.Add(“Hi”); String[] str = list.ToArray();