<?xml version="1.0" encoding="windows-1252"?>
<node id="1005004" title="Re: What is the best way to find username running your script? (Windows)" created="2012-11-21 15:44:29" updated="2012-11-21 15:44:29">
<type id="11">
note</type>
<author id="22609">
tye</author>
<data>
<field name="doctext">
&lt;p&gt;
I use $ENV{USERNAME} because it works on Unix and on Windows, IME.  $ENV{LOGNAME} is probably the oldest one on the Unix side and so may be the most widely supported.  You can even use something like $ENV{LOGNAME} || $ENV{USERNAME} || $ENV{USER} (assuming you don't let anybody have a username of "0").
&lt;/p&gt;&lt;p&gt;
Of course, if you are worried about preventing people from pretending to be somebody else, then you shouldn't rely on an environment variable.
&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-22609"&gt;&lt;p align="right"&gt;
- [tye]&lt;tt&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/tt&gt;
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1004999</field>
<field name="parent_node">
1004999</field>
</data>
</node>
