-
Need to send output of executable from cmd prompt to a text file
I have been working on this on and off for a while and can't seem to find a solution. I am using usrtogrp.exe to add users in AD to a group and I want to pull the results into a text file or straight into a variable for VBA so I can display the results better than just leaving the command prompt open.
Here is what I have so far.
Shell Environ$("COMSPEC") & " /k " & "h:\somefolder\usrtogrp.exe " + "H:\somfolder\adinternet.txt " + "> h:\somefolder\output.txt", 1
I can get this redirect command to work for simple commands like dir, list, etc... but not for and "third party" executable. This code works, except the text file is always blank.
Any insight would be appreciated.
Thanks
Zach
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules