Capturing return value of command line utility

G

Guest

I've been working with this project to create and delete users with an Access
program. The command line utility DSADD is how that works for me.

By using:
Shell ("c:\windows\system32\dsadd.exe user """ & "CN=" & LastName & "\, " &
FullFirstName & ",OU=XXXX Users,DC=XXXX,DC=com""" & " -samid " & Logon & "
-pwd XXXXXX -fn " & Firstname & " -mi " & MI & " -ln " & LastName)
This works with no problem. But how can I capture the response this command
generates? If I run the command in the command window, I get a verbose
response which could be important in an error situation. When I try to dim a
string value equal to the previous shell command, it returns a number. How
can I get the same response from the command line utility in my function that
I get in the command window?
 
G

Guest

Jim,

The standard way to do this would be pipe it into a output file then read
the output. Something like

shell("mycmd.exe > mycmdout.txt")

then fileopen mycmdout.txt and parse the result.

HTH

Peter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top