commandline argument parameter limitation

前端 未结 8 1742
伪装坚强ぢ
伪装坚强ぢ 2021-02-08 09:39

Language: C# I have to pass a huge string array (built dynamically) as an argument to run an exe. I am thinking of acheiving it by the below 2 ways. But I am not feeling confid

8条回答
  •  盖世英雄少女心
    2021-02-08 10:31

    It depends on the OS:

    See Command prompt (Cmd. exe) command-line string limitation on the Microsoft Support site.

    On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters.

    (emphasis mine)

    In regards to the size of a string array - if you have many millions of strings in a string array - you are mostly limited by the amount of memory available.

提交回复
热议问题