That’s not how you write to a file. (Note: this script was written on Mac OS 10.3.2 and “Apple System Profiler” is simply called “System Profiler”.)
set fileinfo to (((path to desktop) as string) & "fileinfo.txt")
tell application "System Profiler"
activate
set info to system profile as text
try
quit
end try
end tell
my write_to_file(fileinfo, info, false)
on write_to_file(the_file, the_string, with_appending)
set the_file to the_file as file specification
try
open for access the_file with write permission
if with_appending = false then set eof of the_file to 0
write (the_string as text) to the_file starting at eof
close access the_file
on error
try
close access the_file
end try
end try
end write_to_file