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?
cbuttonAsked:
Who is Participating?
 
amebaConnect With a Mentor Commented:
You'll need to lounch your Command interpreter, e.g.:
x = Shell("Command.com /c sort filea > fileb")
0
 
cbuttonAuthor Commented:
I don't realy understand why, but that's okay. It works just fine.
0
All Courses

From novice to tech pro — start learning today.