The 'Wscript.shell' COM Automation object and the 'cmd.exe' Windows command shell are not interchangeable. Specifically, a pipe (|) is processed by 'cmd.exe' but you are using 'wscript.shell' which knows nothing about piping standard output to standard input using '|'.
So you need to use cmd.exe. Something like the following:
objShell = ObjectCreate('wscript.shell')
objShell.Run('cmd /c dir c:\ | sort > c:\temp\tmp.txt',0,0)
Also, using quotes and variable substitution as illustrated in your example is just wasting CPU cycles.