
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Windows Environment Variables Archives - TECHNIG</title>
	<atom:link href="https://www.technig.com/tag/windows-environment-variables/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.technig.com/tag/windows-environment-variables/</link>
	<description>Gateway for IT Experts and Tech Geeks</description>
	<lastBuildDate>Sun, 17 Sep 2017 09:30:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://www.technig.com/wp-content/uploads/2020/04/32x32.png</url>
	<title>Windows Environment Variables Archives - TECHNIG</title>
	<link>https://www.technig.com/tag/windows-environment-variables/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">162720667</site>	<item>
		<title>Windows Environment Variables Everything You Must Know</title>
		<link>https://www.technig.com/windows-environment-variables-guide/</link>
					<comments>https://www.technig.com/windows-environment-variables-guide/#respond</comments>
		
		<dc:creator><![CDATA[Hujatulla Asghari]]></dc:creator>
		<pubDate>Sun, 17 Sep 2017 09:30:33 +0000</pubDate>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Command Line Tips]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows 10]]></category>
		<category><![CDATA[Windows Environment Variables]]></category>
		<category><![CDATA[Windows Tips]]></category>
		<guid isPermaLink="false">https://www.technig.com/?p=10573</guid>

					<description><![CDATA[<div style="margin-bottom:20px;"><img width="800" height="420" src="https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" fetchpriority="high" srcset="https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig.jpg 800w, https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig-300x158.jpg 300w, https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig-768x403.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /></div>
<p>You will be counted as power user when you know how to use environment variables. Environment variables are everywhere in windows. This topic might be a little hard for beginner users to comprehend. You will empower to skill once you know how to use environment variables correctly. Windows environment variables are something that everyone should know about. [&#8230;]</p>
<p>The post <a href="https://www.technig.com/windows-environment-variables-guide/">Windows Environment Variables Everything You Must Know</a> appeared first on <a href="https://www.technig.com">TECHNIG</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="margin-bottom:20px;"><img width="800" height="420" src="https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig.jpg 800w, https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig-300x158.jpg 300w, https://www.technig.com/wp-content/uploads/2017/09/Learn-to-Know-About-Windows-Environment-Variables-Technig-768x403.jpg 768w" sizes="(max-width: 800px) 100vw, 800px" /></div><p>You will be counted as power user when you know how to use environment variables. Environment variables are everywhere in windows. This topic might be a little hard for beginner users to comprehend. You will empower to skill once you know how to use environment variables correctly. Windows environment variables are something that everyone should know about. If you don&#8217;t know about it yet, this article is for you. We will cover everything you need to know about it and how you can use it.</p>
<h1>What Is An Environment Variable?</h1>
<p><em>Environment variables describe or show the path to a program or somewhere in your operating system. </em>Let&#8217;s say you want to know where a software is installed or what&#8217;s your computer name. You can use environment variables to find the answer to such questions.</p>
<blockquote><p><em>Environment variables hold values related to the current environment, like the Operating System or user sessions.</em></p></blockquote>
<p>The environment variable has a name and a value. For instance, OneDrive as name and <em><span style="background-color: #dedede">C:\Users\UserName\OneDrive</span> as value. </em></p>
<h2>Where to find the Environment Variables?</h2>
<p>In Windows, You can find the env variables in your system properties.</p>
<figure id="attachment_10575" aria-describedby="caption-attachment-10575" style="width: 701px" class="wp-caption aligncenter"><a href="http://3.90.216.52/wp-content/uploads/2017/09/Windows-Enviroment-Variables.png"><img decoding="async" class="wp-image-10575" src="http://3.90.216.52/wp-content/uploads/2017/09/Windows-Enviroment-Variables.png" alt="Windows Environment Variables" width="701" height="350" srcset="https://www.technig.com/wp-content/uploads/2017/09/Windows-Enviroment-Variables.png 1241w, https://www.technig.com/wp-content/uploads/2017/09/Windows-Enviroment-Variables-300x150.png 300w, https://www.technig.com/wp-content/uploads/2017/09/Windows-Enviroment-Variables-768x384.png 768w, https://www.technig.com/wp-content/uploads/2017/09/Windows-Enviroment-Variables-1024x512.png 1024w" sizes="(max-width: 701px) 100vw, 701px" /></a><figcaption id="caption-attachment-10575" class="wp-caption-text">Windows Environment Variables</figcaption></figure>
<p>You can specify your own path there. As you can see, there is two sections. The first one is for login user specific and the second is for your system.</p>
<figure id="attachment_10576" aria-describedby="caption-attachment-10576" style="width: 577px" class="wp-caption aligncenter"><a href="http://3.90.216.52/wp-content/uploads/2017/09/user-and-system-environment-variables.png"><img decoding="async" class=" wp-image-10576" src="http://3.90.216.52/wp-content/uploads/2017/09/user-and-system-environment-variables.png" alt="user and system environment variables" width="577" height="568" srcset="https://www.technig.com/wp-content/uploads/2017/09/user-and-system-environment-variables.png 630w, https://www.technig.com/wp-content/uploads/2017/09/user-and-system-environment-variables-300x295.png 300w" sizes="(max-width: 577px) 100vw, 577px" /></a><figcaption id="caption-attachment-10576" class="wp-caption-text">user and system environment variables</figcaption></figure>
<h3>What&#8217;s Path?</h3>
<p>in short, Path is the path to an executable software. For example, if you run calc on the run, it will open the calculator. The calc is the variable name and the value is in the system directory.</p>
<figure id="attachment_10577" aria-describedby="caption-attachment-10577" style="width: 617px" class="wp-caption aligncenter"><a href="http://3.90.216.52/wp-content/uploads/2017/09/Path-in-windows-environment-variable.png"><img loading="lazy" decoding="async" class=" wp-image-10577" src="http://3.90.216.52/wp-content/uploads/2017/09/Path-in-windows-environment-variable.png" alt="Path in windows environment variable" width="617" height="346" srcset="https://www.technig.com/wp-content/uploads/2017/09/Path-in-windows-environment-variable.png 1044w, https://www.technig.com/wp-content/uploads/2017/09/Path-in-windows-environment-variable-300x168.png 300w, https://www.technig.com/wp-content/uploads/2017/09/Path-in-windows-environment-variable-768x431.png 768w, https://www.technig.com/wp-content/uploads/2017/09/Path-in-windows-environment-variable-1024x575.png 1024w" sizes="(max-width: 617px) 100vw, 617px" /></a><figcaption id="caption-attachment-10577" class="wp-caption-text">Path in windows environment variable</figcaption></figure>
<h2>How to Use Windows Environment Variables?</h2>
<p>The usage is very common and simple. If you want to open any program from command prompt ( or run in windows ), use environment variable to do that. For example:</p>
<p>Your program is installed in<span style="background-color: #dedede"> </span><em><span style="background-color: #dedede">C:\Program Files\Sublime Text 3.</span> Now you want to run sublime on the run or cmd and it should open sublime text. </em></p>
<p>There are two ways to set environment variables. Using command line, using GUI. You saw how you can access environment variables in the above section. Let&#8217;s see how you can use the command line to access and set variables.</p>
<h3>Format</h3>
<p>Environment Variables in Windows are denoted with percent signs (%) surrounding the name:</p>
<pre><code>%name%
</code></pre>
<h3>echo</h3>
<p>To display an environment variable&#8217;s value in,<code>cmd.exe</code> type.<code>echo %name%</code></p>
<pre><code>C:\&gt;echo %APPDATA%
C:\Users\BigHero\AppData\Roaming
</code></pre>
<h3>set</h3>
<p>To <strong>create or set</strong> a variable, use <code>set variableName=value</code>:</p>
<pre><code>C:\&gt;set subl=<em>C:\Program Files\Sublime Text 3\subl.exe</em>

C:\&gt;set FunnyCatPicturesTwo=%USERPROFILE%\Pictures\Funny Cat Pictures 2
</code></pre>
<p>To <strong>append or add</strong> a variable, use <code>set varname=value;%varname%</code>:</p>
<pre><code>C:\&gt;set Penguins=C:\Linux

C:\&gt;set Penguins=C:\Windows;%Penguins%

C:\&gt;echo %Penguins%
C:\Windows;C:\Linux
</code></pre>
<p>Environment variables set in this way are available for (the rest of) the duration of the Command Prompt process in which they are set, and are available to processes that are started after the variables were set.</p>
<h3>Setx</h3>
<p>To <strong>create or set</strong> a variable <strong>permanently</strong>, use <code>setx varname "value"</code>:</p>
<pre><code>C:\&gt;setx subl "<em>C:\Program Files\Sublime Text 3\subl.exe</em>"

[Restart CMD]
C:\&gt;echo %subl%
C:\Program Files\Sublime Text 3\subl.exe
</code></pre>
<p>Unlike,<code>set</code> there is no equals sign and the value should be enclosed in quotes if it contains any spaces. Note that variables may expand to a string with spaces (e.g., <code>%PATH%</code> becomes <code>C:\Program Files</code>), so it is best to include quotes around values that contain any variables.</p>
<p>You must manually add <code>setx</code> to versions of Windows earlier than Vista.</p>
<p>So far, if you run subl in command prompt or Run, it will give</p>
<pre class="lang:default decode:true">'subl' is not recognized as an internal or external command,
operable program or batch file.</pre>
<p>It&#8217;s because setx didn&#8217;t add the environment variable to the path. As we mentioned before, the path is used to execute any software. Here is how you can fix that.</p>
<ol>
<li>Adding sublime text path to Path environment variables.</li>
<li>Using setx<em> /M</em></li>
</ol>
<p><strong>Add manually.</strong></p>
<figure id="attachment_10589" aria-describedby="caption-attachment-10589" style="width: 643px" class="wp-caption aligncenter"><a href="http://3.90.216.52/wp-content/uploads/2017/09/add-to-path.png"><img loading="lazy" decoding="async" class=" wp-image-10589" src="http://3.90.216.52/wp-content/uploads/2017/09/add-to-path.png" alt="add to path" width="643" height="406" srcset="https://www.technig.com/wp-content/uploads/2017/09/add-to-path.png 1045w, https://www.technig.com/wp-content/uploads/2017/09/add-to-path-300x189.png 300w, https://www.technig.com/wp-content/uploads/2017/09/add-to-path-768x485.png 768w, https://www.technig.com/wp-content/uploads/2017/09/add-to-path-1024x647.png 1024w" sizes="(max-width: 643px) 100vw, 643px" /></a><figcaption id="caption-attachment-10589" class="wp-caption-text">add to the path</figcaption></figure>
<p>After you add, press enter and save.</p>
<p><strong>Use setx /M</strong></p>
<p>Open your command prompt as administrator. (search cmd and press ctrl+ shift + enter).</p>
<pre class="lang:default decode:true ">setx /M path "C:\Program Files\Sublime Text 3"</pre>
<p>That is done now. You can run subl in the command line and it will open the sublime text.</p>
<p><span style="background-color: #ff0000">Note</span>: We don&#8217;t recommend the second way. Because it will override the system path variables.</p>
<h2>Conclusion.</h2>
<p>It was hard for me to understand how the Windows <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx" target="_blank" rel="noopener noreferrer">environment variables</a> work. It took a little time but it worth learning and using. If you have any question, feel free to comment it below.</p>
<p>The post <a href="https://www.technig.com/windows-environment-variables-guide/">Windows Environment Variables Everything You Must Know</a> appeared first on <a href="https://www.technig.com">TECHNIG</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.technig.com/windows-environment-variables-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">10573</post-id>	</item>
	</channel>
</rss>
