<p>By default netbeans stores it's settings in a directory called .netbeans under the user's home directory. Is it possible to change the location of this directory (especially under Windows)?</p>

<p>Thanks to James Schek I now know the answer (change the path in netbeans.conf) but that leads me to another question: 
Is there a way to include the current username in the path to the netbeans setting directory? </p>

<p>I want to do something like this:</p>

<pre><code>netbeans_default_userdir="D:\etc\${USERNAME}\.netbeans\6.5beta"
</code></pre>

<p>but I can't figure out the name of the variable to use (if there's any).
Of course I can achieve the same thing with the --userdir option, I'm just curious.</p>

yes, edit the netbeans.conf file under %NETBEANS_HOME%\etc.
Edit the line with:
netbeans_default_userdir="${HOME}/.netbeans/6.0"
If you need different "profiles"--i.e. want to run different copies of Netbeans with different home directories, you can pass a new home directory to the launcher. Run "netbeans.exe --userdir /path/to/dir" or "nb.exe --userdir /path/to/dir"