You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 11环境变量32767字符限制存疑:实测与官方文档不符的技术咨询

Windows 11环境变量32767字符限制存疑:实测与官方文档不符的技术咨询

See also: Why does Windows have a limit on environment variables at all?

根据Windows应用开发文档所述:“用户定义的环境变量的最大长度为32767字符。”

但我创建了一个Rust包来测试这个限制,结果却出乎意料——我居然能创建一个远超过32767字符的环境变量。


Cargo.toml

[package]
name = "big-variable-test"
edition = "2021"

[[bin]]
name = "big-variable-creator"
path = "src/big_variable_creator.rs"

[[bin]]
name = "big-variable-size-checker"
path = "src/big_variable_size_checker.rs"

src\big_variable_creator.rs

// This is the largest number that I’ve gotte...

备注:内容来源于stack exchange,提问作者Ginger Jesus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 11:04:50