<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Tip of the day: Learn to use environment variables</title>
	<atom:link href="http://www.edbott.com/weblog/?feed=rss2&#038;p=748" rel="self" type="application/rss+xml" />
	<link>http://www.edbott.com/weblog/?p=748</link>
	<description>Helping PC users make sense of Microsoft software since 1991</description>
	<lastBuildDate>Fri, 20 Nov 2009 18:54:09 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ed C.</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-9365</link>
		<dc:creator>Ed C.</dc:creator>
		<pubDate>Wed, 12 Apr 2006 23:32:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-9365</guid>
		<description>I know it probably is possible and if so, What are the commands I can use to create a batch file that will copy a set of files from a networked server and write them to a Rewritable?

Scripting Newbe</description>
		<content:encoded><![CDATA[<p>I know it probably is possible and if so, What are the commands I can use to create a batch file that will copy a set of files from a networked server and write them to a Rewritable?</p>
<p>Scripting Newbe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-5300</link>
		<dc:creator>Iain</dc:creator>
		<pubDate>Thu, 02 Mar 2006 11:24:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-5300</guid>
		<description>Is there a way to use %random% or %time% within the shortcut command line? %username% substitutes but %time% doesn&#039;t. 
They do if you put them in a batch file, but then we get a dos window while our application runs. 

Iain</description>
		<content:encoded><![CDATA[<p>Is there a way to use %random% or %time% within the shortcut command line? %username% substitutes but %time% doesn&#8217;t.<br />
They do if you put them in a batch file, but then we get a dos window while our application runs. </p>
<p>Iain</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Bott</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-3165</link>
		<dc:creator>Ed Bott</dc:creator>
		<pubDate>Fri, 14 Oct 2005 17:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-3165</guid>
		<description>Keith, I&#039;m not aware that the My Documents folder is associated with an environment variable. You should be able to use %userprofile%\My Documents, which will find the default location for the logged-on user. But this will fail if you&#039;ve moved the shell folder using Tweak UI.</description>
		<content:encoded><![CDATA[<p>Keith, I&#8217;m not aware that the My Documents folder is associated with an environment variable. You should be able to use %userprofile%\My Documents, which will find the default location for the logged-on user. But this will fail if you&#8217;ve moved the shell folder using Tweak UI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-3164</link>
		<dc:creator>Keith</dc:creator>
		<pubDate>Fri, 14 Oct 2005 17:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-3164</guid>
		<description>Ed,
You never answered the question on how to find &quot;My documents&quot; for use from scripts. I searched registry, environment variables, and google. Somehow the system must know besides looking at where the shortcut on the desktop points (I think).</description>
		<content:encoded><![CDATA[<p>Ed,<br />
You never answered the question on how to find &#8220;My documents&#8221; for use from scripts. I searched registry, environment variables, and google. Somehow the system must know besides looking at where the shortcut on the desktop points (I think).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Bott</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-2758</link>
		<dc:creator>Ed Bott</dc:creator>
		<pubDate>Mon, 19 Sep 2005 23:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-2758</guid>
		<description>Calvin,

Aha. A little Googling turns up the news that environment variables stored in the Registry are not expanded by default. Apparently you need to use the Expandable String data type to make it work. There&#039;s an interesting article in VBScripting Solutions that might point you in the right direction:

&lt;a href=&quot;http://www.windowsitpro.com/Article/ArticleID/16294/16294.html?Ad=1&quot; rel=&quot;nofollow&quot;&gt;Link&lt;/a&gt;.

Hope that helps!

Ed</description>
		<content:encoded><![CDATA[<p>Calvin,</p>
<p>Aha. A little Googling turns up the news that environment variables stored in the Registry are not expanded by default. Apparently you need to use the Expandable String data type to make it work. There&#8217;s an interesting article in VBScripting Solutions that might point you in the right direction:</p>
<p><a href="http://www.windowsitpro.com/Article/ArticleID/16294/16294.html?Ad=1" rel="nofollow">Link</a>.</p>
<p>Hope that helps!</p>
<p>Ed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Calvin Lo</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-2757</link>
		<dc:creator>Calvin Lo</dc:creator>
		<pubDate>Mon, 19 Sep 2005 22:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-2757</guid>
		<description>Thank you Ed for replying so promptly.

I have read your reply. However, I was able to do the xcopy on logon with the UNC syntax. It is just not copying to the %windir%\system32 directory (instead, it created %windir%\system32\zchecknet.cmd in my user profile under &quot;Documents and Settings&quot;.

Here&#039;s the registry key that I exported:
-----------------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\Run]
&quot;1&quot;=&quot;xcopy /y /v \&quot;\\\\server\\Office Share\\IT\\COMPUTERS\\Tools\\zchecknet.cmd\&quot; %windir%\\system32\\&quot;
---------------
If I replace %windir% in the registry key by c:\windows, then the xcopy works fine (What I am trying to do here is to have the zchecknet.cmd file copied to user computers every time they logon to our domain; I&#039;m controlling this via W2K Group Policy, hence you see the key lies under policies\explorer\run ).

Any other suggestions? Thnx again,
Calvin</description>
		<content:encoded><![CDATA[<p>Thank you Ed for replying so promptly.</p>
<p>I have read your reply. However, I was able to do the xcopy on logon with the UNC syntax. It is just not copying to the %windir%\system32 directory (instead, it created %windir%\system32\zchecknet.cmd in my user profile under &#8220;Documents and Settings&#8221;.</p>
<p>Here&#8217;s the registry key that I exported:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Windows Registry Editor Version 5.00</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\Run]<br />
&#8220;1&#8243;=&#8221;xcopy /y /v \&#8221;\\\\server\\Office Share\\IT\\COMPUTERS\\Tools\\zchecknet.cmd\&#8221; %windir%\\system32\\&#8221;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;<br />
If I replace %windir% in the registry key by c:\windows, then the xcopy works fine (What I am trying to do here is to have the zchecknet.cmd file copied to user computers every time they logon to our domain; I&#8217;m controlling this via W2K Group Policy, hence you see the key lies under policies\explorer\run ).</p>
<p>Any other suggestions? Thnx again,<br />
Calvin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Bott</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-2756</link>
		<dc:creator>Ed Bott</dc:creator>
		<pubDate>Mon, 19 Sep 2005 21:08:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-2756</guid>
		<description>Calvin, you should indeed be able to use environment variables in the way you suggest. However, the reason your command isn&#039;t working is because you can&#039;t use UNC syntax (\\server\share) at a command prompt, and the xcopy command runs in a command shell. Try mapping the server based locations to a drive letter and see if that works.</description>
		<content:encoded><![CDATA[<p>Calvin, you should indeed be able to use environment variables in the way you suggest. However, the reason your command isn&#8217;t working is because you can&#8217;t use UNC syntax (\\server\share) at a command prompt, and the xcopy command runs in a command shell. Try mapping the server based locations to a drive letter and see if that works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Calvin Lo</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-2755</link>
		<dc:creator>Calvin Lo</dc:creator>
		<pubDate>Mon, 19 Sep 2005 21:00:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-2755</guid>
		<description>Hi Ed,
Can I include Environment Variables in the key values of the Registry?
For example, I have the following value in the RUN key, but the %windir% never got expanded to c:\windows\

xcopy /y /v &quot;\\server\Office Share\IT\COMPUTERS\Tools\zchecknet.cmd&quot; %windir%\system32\zchecknet.cmd

Any ideas (please email me if possible)? Thnx!
Calvin</description>
		<content:encoded><![CDATA[<p>Hi Ed,<br />
Can I include Environment Variables in the key values of the Registry?<br />
For example, I have the following value in the RUN key, but the %windir% never got expanded to c:\windows\</p>
<p>xcopy /y /v &#8220;\\server\Office Share\IT\COMPUTERS\Tools\zchecknet.cmd&#8221; %windir%\system32\zchecknet.cmd</p>
<p>Any ideas (please email me if possible)? Thnx!<br />
Calvin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Rodemann</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-1620</link>
		<dc:creator>Phil Rodemann</dc:creator>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-1620</guid>
		<description>As usual Ed you provide usable info that I find essential. How about providing some more examples of how you&#039;ve seen the environmental variables used? I&#039;m in an enterprise environment and do quite a bit of VB Scripting. There must be a few tricks up your sleeve?</description>
		<content:encoded><![CDATA[<p>As usual Ed you provide usable info that I find essential. How about providing some more examples of how you&#8217;ve seen the environmental variables used? I&#8217;m in an enterprise environment and do quite a bit of VB Scripting. There must be a few tricks up your sleeve?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Bott</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-1621</link>
		<dc:creator>Ed Bott</dc:creator>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-1621</guid>
		<description>Phil, at the risk of sounding like I&#039;m plugging my book... Well, OK, I&#039;m plugging the book.

Windows XP Inside Out Deluxe Second Edition has probably 40 pages (maybe more) on using environment variables in scripts and batch files, with lots of really good examples. Most of the work was done by my co-author Carl Siechert. If you haven&#039;t got that book, there&#039;s your starting point!</description>
		<content:encoded><![CDATA[<p>Phil, at the risk of sounding like I&#8217;m plugging my book&#8230; Well, OK, I&#8217;m plugging the book.</p>
<p>Windows XP Inside Out Deluxe Second Edition has probably 40 pages (maybe more) on using environment variables in scripts and batch files, with lots of really good examples. Most of the work was done by my co-author Carl Siechert. If you haven&#8217;t got that book, there&#8217;s your starting point!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Howard</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-1622</link>
		<dc:creator>James Howard</dc:creator>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-1622</guid>
		<description>I&#039;m wanting to find the location of the &quot;My Documents&quot; folder (Which may or may not have been relocated from it&#039;s &#039;usual&#039; location).

Is there a system variable that I can use to locate this?</description>
		<content:encoded><![CDATA[<p>I&#8217;m wanting to find the location of the &#8220;My Documents&#8221; folder (Which may or may not have been relocated from it&#8217;s &#8216;usual&#8217; location).</p>
<p>Is there a system variable that I can use to locate this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Bott</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-1623</link>
		<dc:creator>Ed Bott</dc:creator>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-1623</guid>
		<description>Can&#039;t you just right-click the My Documents icon and see what it says is the Target folder?</description>
		<content:encoded><![CDATA[<p>Can&#8217;t you just right-click the My Documents icon and see what it says is the Target folder?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aeon17x</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-1624</link>
		<dc:creator>Aeon17x</dc:creator>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-1624</guid>
		<description>But what if you&#039;re installing something, and it happens that the user utilizes an OS of a different language (say, Spanish or French)? And even if it is in English, what happens if he redirects his My Documents folder to a different one?</description>
		<content:encoded><![CDATA[<p>But what if you&#8217;re installing something, and it happens that the user utilizes an OS of a different language (say, Spanish or French)? And even if it is in English, what happens if he redirects his My Documents folder to a different one?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gnap</title>
		<link>http://www.edbott.com/weblog/?p=748&#038;cpage=1#comment-1625</link>
		<dc:creator>Gnap</dc:creator>
		<pubDate>Wed, 31 Dec 1969 17:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.edbott.com/wordpress/?p=748#comment-1625</guid>
		<description>Is it possible to add comments in system variables, this could be very handy to comment some settings out temporarily.
Thank you, Greetings, Gnap.
</description>
		<content:encoded><![CDATA[<p>Is it possible to add comments in system variables, this could be very handy to comment some settings out temporarily.<br />
Thank you, Greetings, Gnap.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
