Thanks, Lowell - that's a lot easier than what I've been doing:
declare @sql varchar(4000)
declare @sql2 nvarchar(4000)
declare @targetServerName varchar(100)='targetMachine'
select @sql = 'N''create table [dirlist] ([listrecords] varchar(500)) insert [dirlist] EXEC master.dbo.xp_cmdshell ''''dir...