i'm thinking the issue here is what account is running SQL when you drop to xp_cmdShell; you are choosing trusted connection,w hcih means if the user running the services is not a local user or domain user, it would probably fail:
if you run this, does it return results, or is it all nulls?
DECLARE @Results table(
ID int identity(1,1) NOT NULL,
TheOutput varchar(1000))
insert into @Results (TheOutput)
exec master..xp_cmdshell 'whoami' --nt authority\system for example
insert into @Results (TheOutput)
exec master..xp_cmdshell 'cd %userprofile%' --NULL because nt authority\system is not a user...command fails.
select * from @Results
Lowell