We help IT Professionals succeed at work.

Access data in command prompt in VB.net

n4narik
n4narik asked
on
Medium Priority
167 Views
Last Modified: 2010-04-23
How can we access the data from command prompt in VB.net and put the data in an array?
Say, we execute 'dir', I would like the result in an array in VB.net
Comment
Watch Question

Retired
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
Dim CommandLine() As String = Environment.GetCommandLineArgs()

The first element in the array is the name and path of the executing file all other elements ar the argument list

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
See iboutchkines answer here:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21780733.html

You could instead use the Split() command to break the results out into an array.
Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
Wow...I interpreted that one bass ackwards...   ;)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.