' Capture the results of a command line execution and If it fails, try it with the command shell. Note that some commands you want output from will require you to pass them through the command shell (the "cmd /c" part of the above), while others may work fine if you run them directly without the shell. ![]() With the function below in your VBScript, you could enter: thisDir = getCommandOutput("cmd /c dir c:")Īnd when the above line is executed, the variable "thisDir" would contain the output from the DIR command. ![]() (There would be lots of better ways to get it than this, but I'm just using a simple example.) There is a way to do this without having to write output to a file.įor example, suppose you wanted to capture the text of a directory listing.
0 Comments
Leave a Reply. |