Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello

I can Set variable in cmd by

set xx=10

then If I press set command then I can see that variable.

Now I want to set that variable using c#. Can any body tell me how to do that?

I had also tried

C#
Environment.SetEnvironmentVariable("xx", "10");


But not worked.
Posted

1 solution

It does work, but the variable is not exported to any other command window. It only exists within the environment of that application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900