Redirection in Shell function

I want to sort a text file from within Visual Basic. I tried:
x = Shell("sort filea > fileb"), but I get an error saying that the file ">" can't be found. Obviously it doesn't recognize the > as a redirection.
How can i accomplish the sort?
Who is Participating?
amebaConnect With a Mentor Commented:
You'll need to lounch your Command interpreter, e.g.:
x = Shell(" /c sort filea > fileb")
cbuttonAuthor Commented:
I don't realy understand why, but that's okay. It works just fine.
All Courses

From novice to tech pro — start learning today.