%username% variable in batch
<p>I'd like to be able to pass the username variable to a cmd command in a batch script so I can see if the current user is an administrator. I tried this code <code>start cmd.exe /c "net user %username% &gt; priv.txt"</code>  It doesn't want to work though, whats the problem and is there a better way to do this? Any help or suggestions are appreciated. Thanks everyone. </p>