Managed to do this in batch using set first=%username:~0,1% reg add HKCU\Environment /v FirstLetter /t REG_SZ /d %first% /f
but I'd rather do it in PowerShell, if anyone has any pointers... TIA, JRR On 23 August 2013 11:03, James Rankin <[email protected]> wrote: > Anyone have any ideas how to grab the first character of a string (namely > a username) in PowerShell? > > Plenty of hits on removing the last characters from Google, but nothing > useful > > Cheers, > > > > -- > *James Rankin* > Technical Consultant (ACA, CCA, MCTS) > http://appsensebigot.blogspot.co.uk > -- *James Rankin* Technical Consultant (ACA, CCA, MCTS) http://appsensebigot.blogspot.co.uk

