Solved

Redirection in Shell function

Posted on 2000-03-13
2
170 Views
Last Modified: 2010-05-02
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
Comment
Question by:cbutton
2 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
ID: 2614521
You'll need to lounch your Command interpreter, e.g.:
x = Shell("Command.com /c sort filea > fileb")
0
 

Author Comment

by:cbutton
ID: 2617714
I don't realy understand why, but that's okay. It works just fine.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now