Click here to Skip to main content
11,431,011 members (69,159 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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 22: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)



Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2015
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