How can I pull up data from the Command Prompt using VB/VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beginner4e
    New Member
    • Jun 2007
    • 7

    #1

    How can I pull up data from the Command Prompt using VB/VBA

    hi guys,

    I am trying to pull up some user information from the command prompt using VB. I read a lot about using the shell function and so on and so forth, but I don't really know how to start it. Could you please give me some suggestions? Or sample codes? Here is a part of the code I did:

    p.startinfo.use shellexecute = false
    p.startinfo.red irectstandardou tput = true
    p.startinfo.fil ename = "cmd.exe"
    p.startinfo.arg uments = "user"
    ............

    What I get is: "Microsoft Windows XP [Version...]

    What I need is to pull up some data that is stored there, that I would usually pull using "net user username" + enter

    Thank you in advance!
  • beginner4e
    New Member
    • Jun 2007
    • 7

    #2
    Originally posted by beginner4e
    hi guys,

    I am trying to pull up some user information from the command prompt using VB. I read a lot about using the shell function and so on and so forth, but I don't really know how to start it. Could you please give me some suggestions? Or sample codes? Here is a part of the code I did:

    p.startinfo.use shellexecute = false
    p.startinfo.red irectstandardou tput = true
    p.startinfo.fil ename = "cmd.exe"
    p.startinfo.arg uments = "user"
    ............

    What I get is: "Microsoft Windows XP [Version...]

    What I need is to pull up some data that is stored there, that I would usually pull using "net user username" + enter

    Thank you in advance!


    I just wanted to add that I need to display the data into a listbox and later on I have to manipulate the data. Any suggestions?

    beginner4e

    Comment

    Working...