[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

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?
0
cbutton
Asked:
cbutton
1 Solution
 
amebaCommented:
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now