@echo off :: The "net config" generates several lines of data, among :: them one that has my user name like this :: User name EPHELPS :: I put just that line into a temporary batch file net config | find "User" > temp.bat :: Since the first word in my temporary batch file is "User", :: I'll need to create a batch file named user. The user.bat :: file will have the word "name" as it's first argument :: and the word "EPHELPS" as it's second argument. I'm :: obviously after the second argument here! echo set value=%%2> user.bat :: Now I call my temp.bat which will in turn run user.bat call temp.bat :: Delete the temporary files we made del temp.bat del user.bat :: Display the value we got! echo Your user name is %value% :: Miles Fenton in the UK pointed out that while :: "net config" works under Win9x, you'll need to :: use "net config server" or :: "net config workstation" when running under NT.