Help with script to rename computer.

I have and apple script that renames a computer the first time someone logs in. Everything is working, but because my name is Dagel, Rich it is only naming the computer Dagel, and losses the Rich. Any ideas.

tell application "System Events" to get name of current user
set shortName to result

tell application "System Events" to get full name of current user
set longName to result

do shell script "sudo scutil --set LocalHostName " & quoted form of shortName user name "Admin" password "word" with administrator privileges

do shell script "sudo scutil --set ComputerName " & longName user name "Admin" password "word" with administrator privileges

I think you’re missing quoted form on that last line.

do shell script "sudo scutil --set ComputerName " & quoted form of longName user name "Admin" password "word" with administrator privileges

works great!!! thanks. One more question. I want to send a termianl command with ARD to rename the ones already out there using whoami. How can i pass the whoami value along to the sudo scutil --set LocalHostName command??

Thanks

Rich