Click here to Skip to main content
13,553,357 members
Rate this:
Please Sign up or sign in to vote.
See more:

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
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.

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 |
Web04 | 2.8.180515.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2018
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