将用户环境变量读入批处理文件

时间:2022-01-09 23:03:20

I have an app that's in C# that sets user environment variables

我有一个在C#中设置用户环境变量的应用程序

PCManufacturer and PCModel

PCManufacturer和PCModel

I need to be able to read the values from the variables in a batch file. How do I do this?

我需要能够从批处理文件中读取变量中的值。我该怎么做呢?

I have tried %PCManufacturer% and %PCModel% but they didn't work.

我尝试了%PCManufacturer%和%PCModel%,但它们没有用。

2 个解决方案

#1


Go to a command prompt and execute the SET command. Verify that PCManufacturer and PCModel are in the list, and that they are set to actual values.

转到命令提示符并执行SET命令。验证PCManufacturer和PCModel是否在列表中,并将它们设置为实际值。

#2


c_workman:

As a follow-up, this web page should prove valuable:

作为后续行动,这个网页应该证明是有价值的:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/batch.mspx?mfr=true

#1


Go to a command prompt and execute the SET command. Verify that PCManufacturer and PCModel are in the list, and that they are set to actual values.

转到命令提示符并执行SET命令。验证PCManufacturer和PCModel是否在列表中,并将它们设置为实际值。

#2


c_workman:

As a follow-up, this web page should prove valuable:

作为后续行动,这个网页应该证明是有价值的:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/batch.mspx?mfr=true