Click here to Skip to main content
12,446,850 members (52,424 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
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

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

But not worked.
Posted 27-Jan-13 21:54pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100