|
|
Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code a module that executes a "console command", waits for completion, checks the return code, and is able to capture the console command's output (from a disc file somewhere) to read it back in and analyze the results.
I seem to have it working where I execute the command and wait for completion. But I'm not sure how to check the return code or capture the command's output.
Any clues??
Thanks...
bob
|
|
Hi Bob,
You say you know how to tell when it is done. That being the case, to capture the output try adding output redirection to your command. So if your command is MyProgram.exe you could use:
MyProgram.exe > "C:\MyProgram's Output.txt"
If that does not work, post the code you are using. Maybe post it anyway, then maybe I or someone else can tell you how to get the return code.
Clifford Bass
"Bob Howard" wrote:
[Quoted Text] > Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code a > module that executes a "console command", waits for completion, checks the > return code, and is able to capture the console command's output (from a > disc file somewhere) to read it back in and analyze the results. > > I seem to have it working where I execute the command and wait for > completion. But I'm not sure how to check the return code or capture the > command's output. > > Any clues?? > > Thanks... > > bob
|
|
Thanks... I also need to pass some command line switches to the program, but cannot figure out exactly where to place them. I tested it with the switches both before and after the > ... stuff, but the program seems to not see them and simply starts and ends.
Thanks for the help !!!!
bob
"Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com...
[Quoted Text] > Hi Bob, > > You say you know how to tell when it is done. That being the case, to > capture the output try adding output redirection to your command. So if > your > command is MyProgram.exe you could use: > > MyProgram.exe > "C:\MyProgram's Output.txt" > > If that does not work, post the code you are using. Maybe post it > anyway, then maybe I or someone else can tell you how to get the return > code. > > Clifford Bass > > "Bob Howard" wrote: > >> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code a >> module that executes a "console command", waits for completion, checks >> the >> return code, and is able to capture the console command's output (from a >> disc file somewhere) to read it back in and analyze the results. >> >> I seem to have it working where I execute the command and wait for >> completion. But I'm not sure how to check the return code or capture the >> command's output. >> >> Any clues?? >> >> Thanks... >> >> bob
|
|
BTW, the original command line is:
mailsend.exe -info -smtp smtp.gmail.com
Again, I want to execute the above command (executing the program "mailsend.exe") with the parameters as specified (above) and capture the output. I then want to read the output into my program and analyze the result.
Thanks again...
bob.
"Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com...
[Quoted Text] > Hi Bob, > > You say you know how to tell when it is done. That being the case, to > capture the output try adding output redirection to your command. So if > your > command is MyProgram.exe you could use: > > MyProgram.exe > "C:\MyProgram's Output.txt" > > If that does not work, post the code you are using. Maybe post it > anyway, then maybe I or someone else can tell you how to get the return > code. > > Clifford Bass > > "Bob Howard" wrote: > >> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code a >> module that executes a "console command", waits for completion, checks >> the >> return code, and is able to capture the console command's output (from a >> disc file somewhere) to read it back in and analyze the results. >> >> I seem to have it working where I execute the command and wait for >> completion. But I'm not sure how to check the return code or capture the >> command's output. >> >> Any clues?? >> >> Thanks... >> >> bob
|
|
Presumably Mailsend displays it's results to the standard output when it has finished doing whatever it does. you can test this by running your command line from a command prompt, and see what happens. You can capture this content by redirecting the standard output to a file using the redirect operator (>). So... from a command prompt type something like this...
mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt
If a file "mytxtfile.txt" is created in the current directory then you are good to go. At least this should be easy enough to try.
Rdub
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] > BTW, the original command line is: > > mailsend.exe -info -smtp smtp.gmail.com > > Again, I want to execute the above command (executing the program > "mailsend.exe") with the parameters as specified (above) and capture the > output. I then want to read the output into my program and analyze the > result. > > Thanks again... > > bob. > > > "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in message > news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >> Hi Bob, >> >> You say you know how to tell when it is done. That being the case, >> to >> capture the output try adding output redirection to your command. So if >> your >> command is MyProgram.exe you could use: >> >> MyProgram.exe > "C:\MyProgram's Output.txt" >> >> If that does not work, post the code you are using. Maybe post it >> anyway, then maybe I or someone else can tell you how to get the return >> code. >> >> Clifford Bass >> >> "Bob Howard" wrote: >> >>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code a >>> module that executes a "console command", waits for completion, checks >>> the >>> return code, and is able to capture the console command's output (from a >>> disc file somewhere) to read it back in and analyze the results. >>> >>> I seem to have it working where I execute the command and wait for >>> completion. But I'm not sure how to check the return code or capture >>> the >>> command's output. >>> >>> Any clues?? >>> >>> Thanks... >>> >>> bob > >
|
|
I've been doing my initial tests by trying to execute this command from the Windows "Run" in the Start menu --- and this is where it doesn't work. But when I run it from a command prompt, it works!
My next test will be to run this from the VBA module and see what happens.
THANKS SO MUCH!!!!!
Bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Presumably Mailsend displays it's results to the standard output when it > has finished doing whatever it does. you can test this by running your > command line from a command prompt, and see what happens. You can > capture this content by redirecting the standard output to a file using > the redirect operator (>). So... from a command prompt type something > like this... > > mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt > > If a file "mytxtfile.txt" is created in the current directory then you are > good to go. At least this should be easy enough to try. > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >> BTW, the original command line is: >> >> mailsend.exe -info -smtp smtp.gmail.com >> >> Again, I want to execute the above command (executing the program >> "mailsend.exe") with the parameters as specified (above) and capture the >> output. I then want to read the output into my program and analyze the >> result. >> >> Thanks again... >> >> bob. >> >> >> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in message >> news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>> Hi Bob, >>> >>> You say you know how to tell when it is done. That being the case, >>> to >>> capture the output try adding output redirection to your command. So if >>> your >>> command is MyProgram.exe you could use: >>> >>> MyProgram.exe > "C:\MyProgram's Output.txt" >>> >>> If that does not work, post the code you are using. Maybe post it >>> anyway, then maybe I or someone else can tell you how to get the return >>> code. >>> >>> Clifford Bass >>> >>> "Bob Howard" wrote: >>> >>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code >>>> a >>>> module that executes a "console command", waits for completion, checks >>>> the >>>> return code, and is able to capture the console command's output (from >>>> a >>>> disc file somewhere) to read it back in and analyze the results. >>>> >>>> I seem to have it working where I execute the command and wait for >>>> completion. But I'm not sure how to check the return code or capture >>>> the >>>> command's output. >>>> >>>> Any clues?? >>>> >>>> Thanks... >>>> >>>> bob >> >> > >
|
|
It does not work in the VBA code. I'm using the "ShellWait" code from Terry Kreft to execute the command and wait for completion. Bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Presumably Mailsend displays it's results to the standard output when it > has finished doing whatever it does. you can test this by running your > command line from a command prompt, and see what happens. You can > capture this content by redirecting the standard output to a file using > the redirect operator (>). So... from a command prompt type something > like this... > > mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt > > If a file "mytxtfile.txt" is created in the current directory then you are > good to go. At least this should be easy enough to try. > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >> BTW, the original command line is: >> >> mailsend.exe -info -smtp smtp.gmail.com >> >> Again, I want to execute the above command (executing the program >> "mailsend.exe") with the parameters as specified (above) and capture the >> output. I then want to read the output into my program and analyze the >> result. >> >> Thanks again... >> >> bob. >> >> >> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in message >> news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>> Hi Bob, >>> >>> You say you know how to tell when it is done. That being the case, >>> to >>> capture the output try adding output redirection to your command. So if >>> your >>> command is MyProgram.exe you could use: >>> >>> MyProgram.exe > "C:\MyProgram's Output.txt" >>> >>> If that does not work, post the code you are using. Maybe post it >>> anyway, then maybe I or someone else can tell you how to get the return >>> code. >>> >>> Clifford Bass >>> >>> "Bob Howard" wrote: >>> >>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code >>>> a >>>> module that executes a "console command", waits for completion, checks >>>> the >>>> return code, and is able to capture the console command's output (from >>>> a >>>> disc file somewhere) to read it back in and analyze the results. >>>> >>>> I seem to have it working where I execute the command and wait for >>>> completion. But I'm not sure how to check the return code or capture >>>> the >>>> command's output. >>>> >>>> Any clues?? >>>> >>>> Thanks... >>>> >>>> bob >> >> > >
|
|
Hi again,
I just tried running it using the standard VBA "Shell" function, and it does not work (no output produced anywhere). It's as if the whole command line it being tossed... When I remove the redirection of the output, it works fine (except the output goes to a DOS-like Window).
BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the application, and it works fine.
bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Presumably Mailsend displays it's results to the standard output when it > has finished doing whatever it does. you can test this by running your > command line from a command prompt, and see what happens. You can > capture this content by redirecting the standard output to a file using > the redirect operator (>). So... from a command prompt type something > like this... > > mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt > > If a file "mytxtfile.txt" is created in the current directory then you are > good to go. At least this should be easy enough to try. > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >> BTW, the original command line is: >> >> mailsend.exe -info -smtp smtp.gmail.com >> >> Again, I want to execute the above command (executing the program >> "mailsend.exe") with the parameters as specified (above) and capture the >> output. I then want to read the output into my program and analyze the >> result. >> >> Thanks again... >> >> bob. >> >> >> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in message >> news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>> Hi Bob, >>> >>> You say you know how to tell when it is done. That being the case, >>> to >>> capture the output try adding output redirection to your command. So if >>> your >>> command is MyProgram.exe you could use: >>> >>> MyProgram.exe > "C:\MyProgram's Output.txt" >>> >>> If that does not work, post the code you are using. Maybe post it >>> anyway, then maybe I or someone else can tell you how to get the return >>> code. >>> >>> Clifford Bass >>> >>> "Bob Howard" wrote: >>> >>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code >>>> a >>>> module that executes a "console command", waits for completion, checks >>>> the >>>> return code, and is able to capture the console command's output (from >>>> a >>>> disc file somewhere) to read it back in and analyze the results. >>>> >>>> I seem to have it working where I execute the command and wait for >>>> completion. But I'm not sure how to check the return code or capture >>>> the >>>> command's output. >>>> >>>> Any clues?? >>>> >>>> Thanks... >>>> >>>> bob >> >> > >
|
|
What happens when you try to redirect the output from a command prompt?
You might also want to try Piping the output to a file with the Pipe operator (|). I doubt there'd be any difference but what the heck. Command line would be ...
mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt
If redirection and/or piping does NOT work from a command prompt, then your sucking smelly wind trying to make it work in your Access App. If it does work from a command prompt, but not in your app, show us a few lines of your calling code.
Rdub
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text] > Hi again, > > I just tried running it using the standard VBA "Shell" function, and it > does not work (no output produced anywhere). It's as if the whole command > line it being tossed... When I remove the redirection of the output, it > works fine (except the output goes to a DOS-like Window). > > BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the > application, and it works fine. > > bob > > > "Ron Weiner" <rweineratworksritedotcom> wrote in message > news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >> Presumably Mailsend displays it's results to the standard output when it >> has finished doing whatever it does. you can test this by running your >> command line from a command prompt, and see what happens. You can >> capture this content by redirecting the standard output to a file using >> the redirect operator (>). So... from a command prompt type something >> like this... >> >> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >> >> If a file "mytxtfile.txt" is created in the current directory then you >> are good to go. At least this should be easy enough to try. >> >> Rdub >> >> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>> BTW, the original command line is: >>> >>> mailsend.exe -info -smtp smtp.gmail.com >>> >>> Again, I want to execute the above command (executing the program >>> "mailsend.exe") with the parameters as specified (above) and capture the >>> output. I then want to read the output into my program and analyze the >>> result. >>> >>> Thanks again... >>> >>> bob. >>> >>> >>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>> Hi Bob, >>>> >>>> You say you know how to tell when it is done. That being the case, >>>> to >>>> capture the output try adding output redirection to your command. So >>>> if your >>>> command is MyProgram.exe you could use: >>>> >>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>> >>>> If that does not work, post the code you are using. Maybe post it >>>> anyway, then maybe I or someone else can tell you how to get the return >>>> code. >>>> >>>> Clifford Bass >>>> >>>> "Bob Howard" wrote: >>>> >>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to code >>>>> a >>>>> module that executes a "console command", waits for completion, checks >>>>> the >>>>> return code, and is able to capture the console command's output (from >>>>> a >>>>> disc file somewhere) to read it back in and analyze the results. >>>>> >>>>> I seem to have it working where I execute the command and wait for >>>>> completion. But I'm not sure how to check the return code or capture >>>>> the >>>>> command's output. >>>>> >>>>> Any clues?? >>>>> >>>>> Thanks... >>>>> >>>>> bob >>> >>> >> >> > >
|
|
From an actual command prompt, the redirect works. But from the Access code, it does not. I'll try the pipe thingy and get back with you. Thanks again.... bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text] > What happens when you try to redirect the output from a command prompt? > > You might also want to try Piping the output to a file with the Pipe > operator (|). I doubt there'd be any difference but what the heck. > Command line would be ... > > mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt > > If redirection and/or piping does NOT work from a command prompt, then > your sucking smelly wind trying to make it work in your Access App. If it > does work from a command prompt, but not in your app, show us a few lines > of your calling code. > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >> Hi again, >> >> I just tried running it using the standard VBA "Shell" function, and it >> does not work (no output produced anywhere). It's as if the whole >> command line it being tossed... When I remove the redirection of the >> output, it works fine (except the output goes to a DOS-like Window). >> >> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >> application, and it works fine. >> >> bob >> >> >> "Ron Weiner" <rweineratworksritedotcom> wrote in message >> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>> Presumably Mailsend displays it's results to the standard output when it >>> has finished doing whatever it does. you can test this by running your >>> command line from a command prompt, and see what happens. You can >>> capture this content by redirecting the standard output to a file using >>> the redirect operator (>). So... from a command prompt type something >>> like this... >>> >>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>> >>> If a file "mytxtfile.txt" is created in the current directory then you >>> are good to go. At least this should be easy enough to try. >>> >>> Rdub >>> >>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>> BTW, the original command line is: >>>> >>>> mailsend.exe -info -smtp smtp.gmail.com >>>> >>>> Again, I want to execute the above command (executing the program >>>> "mailsend.exe") with the parameters as specified (above) and capture >>>> the output. I then want to read the output into my program and analyze >>>> the result. >>>> >>>> Thanks again... >>>> >>>> bob. >>>> >>>> >>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>> Hi Bob, >>>>> >>>>> You say you know how to tell when it is done. That being the >>>>> case, to >>>>> capture the output try adding output redirection to your command. So >>>>> if your >>>>> command is MyProgram.exe you could use: >>>>> >>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>> >>>>> If that does not work, post the code you are using. Maybe post it >>>>> anyway, then maybe I or someone else can tell you how to get the >>>>> return code. >>>>> >>>>> Clifford Bass >>>>> >>>>> "Bob Howard" wrote: >>>>> >>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>> code a >>>>>> module that executes a "console command", waits for completion, >>>>>> checks the >>>>>> return code, and is able to capture the console command's output >>>>>> (from a >>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>> >>>>>> I seem to have it working where I execute the command and wait for >>>>>> completion. But I'm not sure how to check the return code or capture >>>>>> the >>>>>> command's output. >>>>>> >>>>>> Any clues?? >>>>>> >>>>>> Thanks... >>>>>> >>>>>> bob >>>> >>>> >>> >>> >> >> > >
|
|
Nope --- doesn't work with the pipe.. bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text] > What happens when you try to redirect the output from a command prompt? > > You might also want to try Piping the output to a file with the Pipe > operator (|). I doubt there'd be any difference but what the heck. > Command line would be ... > > mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt > > If redirection and/or piping does NOT work from a command prompt, then > your sucking smelly wind trying to make it work in your Access App. If it > does work from a command prompt, but not in your app, show us a few lines > of your calling code. > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >> Hi again, >> >> I just tried running it using the standard VBA "Shell" function, and it >> does not work (no output produced anywhere). It's as if the whole >> command line it being tossed... When I remove the redirection of the >> output, it works fine (except the output goes to a DOS-like Window). >> >> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >> application, and it works fine. >> >> bob >> >> >> "Ron Weiner" <rweineratworksritedotcom> wrote in message >> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>> Presumably Mailsend displays it's results to the standard output when it >>> has finished doing whatever it does. you can test this by running your >>> command line from a command prompt, and see what happens. You can >>> capture this content by redirecting the standard output to a file using >>> the redirect operator (>). So... from a command prompt type something >>> like this... >>> >>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>> >>> If a file "mytxtfile.txt" is created in the current directory then you >>> are good to go. At least this should be easy enough to try. >>> >>> Rdub >>> >>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>> BTW, the original command line is: >>>> >>>> mailsend.exe -info -smtp smtp.gmail.com >>>> >>>> Again, I want to execute the above command (executing the program >>>> "mailsend.exe") with the parameters as specified (above) and capture >>>> the output. I then want to read the output into my program and analyze >>>> the result. >>>> >>>> Thanks again... >>>> >>>> bob. >>>> >>>> >>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>> Hi Bob, >>>>> >>>>> You say you know how to tell when it is done. That being the >>>>> case, to >>>>> capture the output try adding output redirection to your command. So >>>>> if your >>>>> command is MyProgram.exe you could use: >>>>> >>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>> >>>>> If that does not work, post the code you are using. Maybe post it >>>>> anyway, then maybe I or someone else can tell you how to get the >>>>> return code. >>>>> >>>>> Clifford Bass >>>>> >>>>> "Bob Howard" wrote: >>>>> >>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>> code a >>>>>> module that executes a "console command", waits for completion, >>>>>> checks the >>>>>> return code, and is able to capture the console command's output >>>>>> (from a >>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>> >>>>>> I seem to have it working where I execute the command and wait for >>>>>> completion. But I'm not sure how to check the return code or capture >>>>>> the >>>>>> command's output. >>>>>> >>>>>> Any clues?? >>>>>> >>>>>> Thanks... >>>>>> >>>>>> bob >>>> >>>> >>> >>> >> >> > >
|
|
Let's see the actual VBA code you're using.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!)
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Nope --- doesn't work with the pipe.. bob > > "Ron Weiner" <rweineratworksritedotcom> wrote in message > news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >> What happens when you try to redirect the output from a command prompt? >> >> You might also want to try Piping the output to a file with the Pipe >> operator (|). I doubt there'd be any difference but what the heck. >> Command line would be ... >> >> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >> >> If redirection and/or piping does NOT work from a command prompt, then >> your sucking smelly wind trying to make it work in your Access App. If >> it does work from a command prompt, but not in your app, show us a few >> lines of your calling code. >> >> Rdub >> >> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>> Hi again, >>> >>> I just tried running it using the standard VBA "Shell" function, and it >>> does not work (no output produced anywhere). It's as if the whole >>> command line it being tossed... When I remove the redirection of the >>> output, it works fine (except the output goes to a DOS-like Window). >>> >>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >>> application, and it works fine. >>> >>> bob >>> >>> >>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>> Presumably Mailsend displays it's results to the standard output when >>>> it has finished doing whatever it does. you can test this by running >>>> your command line from a command prompt, and see what happens. You >>>> can capture this content by redirecting the standard output to a file >>>> using the redirect operator (>). So... from a command prompt type >>>> something like this... >>>> >>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>> >>>> If a file "mytxtfile.txt" is created in the current directory then you >>>> are good to go. At least this should be easy enough to try. >>>> >>>> Rdub >>>> >>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>> BTW, the original command line is: >>>>> >>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>> >>>>> Again, I want to execute the above command (executing the program >>>>> "mailsend.exe") with the parameters as specified (above) and capture >>>>> the output. I then want to read the output into my program and >>>>> analyze the result. >>>>> >>>>> Thanks again... >>>>> >>>>> bob. >>>>> >>>>> >>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>> Hi Bob, >>>>>> >>>>>> You say you know how to tell when it is done. That being the >>>>>> case, to >>>>>> capture the output try adding output redirection to your command. So >>>>>> if your >>>>>> command is MyProgram.exe you could use: >>>>>> >>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>> >>>>>> If that does not work, post the code you are using. Maybe post >>>>>> it >>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>> return code. >>>>>> >>>>>> Clifford Bass >>>>>> >>>>>> "Bob Howard" wrote: >>>>>> >>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>>> code a >>>>>>> module that executes a "console command", waits for completion, >>>>>>> checks the >>>>>>> return code, and is able to capture the console command's output >>>>>>> (from a >>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>> >>>>>>> I seem to have it working where I execute the command and wait for >>>>>>> completion. But I'm not sure how to check the return code or >>>>>>> capture the >>>>>>> command's output. >>>>>>> >>>>>>> Any clues?? >>>>>>> >>>>>>> Thanks... >>>>>>> >>>>>>> bob >>>>> >>>>> >>>> >>>> >>> >>> >> >> > >
|
|
Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp smtp.gmail.com >c:\gmailoutput.txt 2>%1", vbNormalFocus
(of course, all of the above is on a single line)
bob
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Let's see the actual VBA code you're using. > > -- > Doug Steele, Microsoft Access MVP > http://I.Am/DougSteele> (no e-mails, please!) > > > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >> Nope --- doesn't work with the pipe.. bob >> >> "Ron Weiner" <rweineratworksritedotcom> wrote in message >> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>> What happens when you try to redirect the output from a command prompt? >>> >>> You might also want to try Piping the output to a file with the Pipe >>> operator (|). I doubt there'd be any difference but what the heck. >>> Command line would be ... >>> >>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>> >>> If redirection and/or piping does NOT work from a command prompt, then >>> your sucking smelly wind trying to make it work in your Access App. If >>> it does work from a command prompt, but not in your app, show us a few >>> lines of your calling code. >>> >>> Rdub >>> >>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>> Hi again, >>>> >>>> I just tried running it using the standard VBA "Shell" function, and it >>>> does not work (no output produced anywhere). It's as if the whole >>>> command line it being tossed... When I remove the redirection of the >>>> output, it works fine (except the output goes to a DOS-like Window). >>>> >>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >>>> application, and it works fine. >>>> >>>> bob >>>> >>>> >>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>> Presumably Mailsend displays it's results to the standard output when >>>>> it has finished doing whatever it does. you can test this by running >>>>> your command line from a command prompt, and see what happens. You >>>>> can capture this content by redirecting the standard output to a file >>>>> using the redirect operator (>). So... from a command prompt type >>>>> something like this... >>>>> >>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>> >>>>> If a file "mytxtfile.txt" is created in the current directory then you >>>>> are good to go. At least this should be easy enough to try. >>>>> >>>>> Rdub >>>>> >>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>> BTW, the original command line is: >>>>>> >>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>> >>>>>> Again, I want to execute the above command (executing the program >>>>>> "mailsend.exe") with the parameters as specified (above) and capture >>>>>> the output. I then want to read the output into my program and >>>>>> analyze the result. >>>>>> >>>>>> Thanks again... >>>>>> >>>>>> bob. >>>>>> >>>>>> >>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>> Hi Bob, >>>>>>> >>>>>>> You say you know how to tell when it is done. That being the >>>>>>> case, to >>>>>>> capture the output try adding output redirection to your command. >>>>>>> So if your >>>>>>> command is MyProgram.exe you could use: >>>>>>> >>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>> >>>>>>> If that does not work, post the code you are using. Maybe post >>>>>>> it >>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>> return code. >>>>>>> >>>>>>> Clifford Bass >>>>>>> >>>>>>> "Bob Howard" wrote: >>>>>>> >>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>>>> code a >>>>>>>> module that executes a "console command", waits for completion, >>>>>>>> checks the >>>>>>>> return code, and is able to capture the console command's output >>>>>>>> (from a >>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>> >>>>>>>> I seem to have it working where I execute the command and wait for >>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>> capture the >>>>>>>> command's output. >>>>>>>> >>>>>>>> Any clues?? >>>>>>>> >>>>>>>> Thanks... >>>>>>>> >>>>>>>> bob >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> >
|
|
Couple of questions.
Does your user account have permissions to write a file in the root of the hard drive. If you are gonna want to run this code under Vista, you will want to rething this location.
What the heck is the 2>%1 at the end of the Command line.
What happens if you type that command directly from the command prompt?
Rdub
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:u1QQYDRTJHA.1960[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text] > Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp smtp.gmail.com > >c:\gmailoutput.txt 2>%1", vbNormalFocus > > > (of course, all of the above is on a single line) > > bob > > "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message > news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl... >> Let's see the actual VBA code you're using. >> >> -- >> Doug Steele, Microsoft Access MVP >> http://I.Am/DougSteele>> (no e-mails, please!) >> >> >> >> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >> news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >>> Nope --- doesn't work with the pipe.. bob >>> >>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>>> What happens when you try to redirect the output from a command prompt? >>>> >>>> You might also want to try Piping the output to a file with the Pipe >>>> operator (|). I doubt there'd be any difference but what the heck. >>>> Command line would be ... >>>> >>>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>>> >>>> If redirection and/or piping does NOT work from a command prompt, then >>>> your sucking smelly wind trying to make it work in your Access App. If >>>> it does work from a command prompt, but not in your app, show us a few >>>> lines of your calling code. >>>> >>>> Rdub >>>> >>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>>> Hi again, >>>>> >>>>> I just tried running it using the standard VBA "Shell" function, and >>>>> it does not work (no output produced anywhere). It's as if the whole >>>>> command line it being tossed... When I remove the redirection of the >>>>> output, it works fine (except the output goes to a DOS-like Window). >>>>> >>>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >>>>> application, and it works fine. >>>>> >>>>> bob >>>>> >>>>> >>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>>> Presumably Mailsend displays it's results to the standard output when >>>>>> it has finished doing whatever it does. you can test this by running >>>>>> your command line from a command prompt, and see what happens. You >>>>>> can capture this content by redirecting the standard output to a file >>>>>> using the redirect operator (>). So... from a command prompt type >>>>>> something like this... >>>>>> >>>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>>> >>>>>> If a file "mytxtfile.txt" is created in the current directory then >>>>>> you are good to go. At least this should be easy enough to try. >>>>>> >>>>>> Rdub >>>>>> >>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>>> BTW, the original command line is: >>>>>>> >>>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>>> >>>>>>> Again, I want to execute the above command (executing the program >>>>>>> "mailsend.exe") with the parameters as specified (above) and capture >>>>>>> the output. I then want to read the output into my program and >>>>>>> analyze the result. >>>>>>> >>>>>>> Thanks again... >>>>>>> >>>>>>> bob. >>>>>>> >>>>>>> >>>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>>> Hi Bob, >>>>>>>> >>>>>>>> You say you know how to tell when it is done. That being the >>>>>>>> case, to >>>>>>>> capture the output try adding output redirection to your command. >>>>>>>> So if your >>>>>>>> command is MyProgram.exe you could use: >>>>>>>> >>>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>>> >>>>>>>> If that does not work, post the code you are using. Maybe post >>>>>>>> it >>>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>>> return code. >>>>>>>> >>>>>>>> Clifford Bass >>>>>>>> >>>>>>>> "Bob Howard" wrote: >>>>>>>> >>>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>>>>> code a >>>>>>>>> module that executes a "console command", waits for completion, >>>>>>>>> checks the >>>>>>>>> return code, and is able to capture the console command's output >>>>>>>>> (from a >>>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>>> >>>>>>>>> I seem to have it working where I execute the command and wait for >>>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>>> capture the >>>>>>>>> command's output. >>>>>>>>> >>>>>>>>> Any clues?? >>>>>>>>> >>>>>>>>> Thanks... >>>>>>>>> >>>>>>>>> bob >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> > >
|
|
I have permission (Administrator).
Everything works if I type it in a command prompt.
The 2>%1 redirects STDERR (handle 2)to be written to STDOUT (handle 1).
As I indicated previously, when running this from within Access, the entire command line (including everything after the >) is not being interpreted by Windows (to redirect the output), but rather is simply being passed to the program being executed as parameters.
A simple test of this is to replace the program name with notepad.exe. I just ran the following test:
Shell "notepad.exe C:\Martureo.Org\ChurchTrax\ChurchTraxLocalOptions.exe >c:\result.txt", vnNormalFocus
When running this, Notepad starts and then displays an error message (because it's seeing the string ">c:\result.txt" as one of its parameters.
But if I then modify this and remove the redirection, Notepad opens and shows the desired file on the screen.
Clearly, the ability to redirect output cannot be done (in this manner) using "Shell".
bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:%23Z%23nTZRTJHA.5568[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Couple of questions. > > Does your user account have permissions to write a file in the root of the > hard drive. If you are gonna want to run this code under Vista, you will > want to rething this location. > > What the heck is the 2>%1 at the end of the Command line. > > What happens if you type that command directly from the command prompt? > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:u1QQYDRTJHA.1960[ at ]TK2MSFTNGP04.phx.gbl... >> Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp smtp.gmail.com >> >c:\gmailoutput.txt 2>%1", vbNormalFocus >> >> >> (of course, all of the above is on a single line) >> >> bob >> >> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message >> news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl... >>> Let's see the actual VBA code you're using. >>> >>> -- >>> Doug Steele, Microsoft Access MVP >>> http://I.Am/DougSteele>>> (no e-mails, please!) >>> >>> >>> >>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>> news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >>>> Nope --- doesn't work with the pipe.. bob >>>> >>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>>>> What happens when you try to redirect the output from a command >>>>> prompt? >>>>> >>>>> You might also want to try Piping the output to a file with the Pipe >>>>> operator (|). I doubt there'd be any difference but what the heck. >>>>> Command line would be ... >>>>> >>>>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>>>> >>>>> If redirection and/or piping does NOT work from a command prompt, then >>>>> your sucking smelly wind trying to make it work in your Access App. >>>>> If it does work from a command prompt, but not in your app, show us a >>>>> few lines of your calling code. >>>>> >>>>> Rdub >>>>> >>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>>>> Hi again, >>>>>> >>>>>> I just tried running it using the standard VBA "Shell" function, and >>>>>> it does not work (no output produced anywhere). It's as if the whole >>>>>> command line it being tossed... When I remove the redirection of the >>>>>> output, it works fine (except the output goes to a DOS-like Window). >>>>>> >>>>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >>>>>> application, and it works fine. >>>>>> >>>>>> bob >>>>>> >>>>>> >>>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>>>> Presumably Mailsend displays it's results to the standard output >>>>>>> when it has finished doing whatever it does. you can test this by >>>>>>> running your command line from a command prompt, and see what >>>>>>> happens. You can capture this content by redirecting the standard >>>>>>> output to a file using the redirect operator (>). So... from a >>>>>>> command prompt type something like this... >>>>>>> >>>>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>>>> >>>>>>> If a file "mytxtfile.txt" is created in the current directory then >>>>>>> you are good to go. At least this should be easy enough to try. >>>>>>> >>>>>>> Rdub >>>>>>> >>>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>>>> BTW, the original command line is: >>>>>>>> >>>>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>>>> >>>>>>>> Again, I want to execute the above command (executing the program >>>>>>>> "mailsend.exe") with the parameters as specified (above) and >>>>>>>> capture the output. I then want to read the output into my program >>>>>>>> and analyze the result. >>>>>>>> >>>>>>>> Thanks again... >>>>>>>> >>>>>>>> bob. >>>>>>>> >>>>>>>> >>>>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>>>> Hi Bob, >>>>>>>>> >>>>>>>>> You say you know how to tell when it is done. That being the >>>>>>>>> case, to >>>>>>>>> capture the output try adding output redirection to your command. >>>>>>>>> So if your >>>>>>>>> command is MyProgram.exe you could use: >>>>>>>>> >>>>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>>>> >>>>>>>>> If that does not work, post the code you are using. Maybe >>>>>>>>> post it >>>>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>>>> return code. >>>>>>>>> >>>>>>>>> Clifford Bass >>>>>>>>> >>>>>>>>> "Bob Howard" wrote: >>>>>>>>> >>>>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>>>>>> code a >>>>>>>>>> module that executes a "console command", waits for completion, >>>>>>>>>> checks the >>>>>>>>>> return code, and is able to capture the console command's output >>>>>>>>>> (from a >>>>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>>>> >>>>>>>>>> I seem to have it working where I execute the command and wait >>>>>>>>>> for >>>>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>>>> capture the >>>>>>>>>> command's output. >>>>>>>>>> >>>>>>>>>> Any clues?? >>>>>>>>>> >>>>>>>>>> Thanks... >>>>>>>>>> >>>>>>>>>> bob >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >> >> > >
|
|
I also posted this matter on the Windows newsgroup and received the following:
" ... the args are passed to the program to parse. You could try to shell to cmd, or write a temporary .bat file"
So what he's saying is that cmd.exe is responsible for interpreting the redirect parms ... and obviously cmd.exe is not being executed.
I'll post results here of my additional testing...
bob
"Ron Weiner" <rweineratworksritedotcom> wrote in message news:%23Z%23nTZRTJHA.5568[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text] > Couple of questions. > > Does your user account have permissions to write a file in the root of the > hard drive. If you are gonna want to run this code under Vista, you will > want to rething this location. > > What the heck is the 2>%1 at the end of the Command line. > > What happens if you type that command directly from the command prompt? > > Rdub > > "Bob Howard" <info[ at ]churchtrax.com> wrote in message > news:u1QQYDRTJHA.1960[ at ]TK2MSFTNGP04.phx.gbl... >> Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp smtp.gmail.com >> >c:\gmailoutput.txt 2>%1", vbNormalFocus >> >> >> (of course, all of the above is on a single line) >> >> bob >> >> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message >> news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl... >>> Let's see the actual VBA code you're using. >>> >>> -- >>> Doug Steele, Microsoft Access MVP >>> http://I.Am/DougSteele>>> (no e-mails, please!) >>> >>> >>> >>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>> news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >>>> Nope --- doesn't work with the pipe.. bob >>>> >>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>>>> What happens when you try to redirect the output from a command >>>>> prompt? >>>>> >>>>> You might also want to try Piping the output to a file with the Pipe >>>>> operator (|). I doubt there'd be any difference but what the heck. >>>>> Command line would be ... >>>>> >>>>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>>>> >>>>> If redirection and/or piping does NOT work from a command prompt, then >>>>> your sucking smelly wind trying to make it work in your Access App. >>>>> If it does work from a command prompt, but not in your app, show us a >>>>> few lines of your calling code. >>>>> >>>>> Rdub >>>>> >>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>>>> Hi again, >>>>>> >>>>>> I just tried running it using the standard VBA "Shell" function, and >>>>>> it does not work (no output produced anywhere). It's as if the whole >>>>>> command line it being tossed... When I remove the redirection of the >>>>>> output, it works fine (except the output goes to a DOS-like Window). >>>>>> >>>>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in the >>>>>> application, and it works fine. >>>>>> >>>>>> bob >>>>>> >>>>>> >>>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>>>> Presumably Mailsend displays it's results to the standard output >>>>>>> when it has finished doing whatever it does. you can test this by >>>>>>> running your command line from a command prompt, and see what >>>>>>> happens. You can capture this content by redirecting the standard >>>>>>> output to a file using the redirect operator (>). So... from a >>>>>>> command prompt type something like this... >>>>>>> >>>>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>>>> >>>>>>> If a file "mytxtfile.txt" is created in the current directory then >>>>>>> you are good to go. At least this should be easy enough to try. >>>>>>> >>>>>>> Rdub >>>>>>> >>>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>>>> BTW, the original command line is: >>>>>>>> >>>>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>>>> >>>>>>>> Again, I want to execute the above command (executing the program >>>>>>>> "mailsend.exe") with the parameters as specified (above) and >>>>>>>> capture the output. I then want to read the output into my program >>>>>>>> and analyze the result. >>>>>>>> >>>>>>>> Thanks again... >>>>>>>> >>>>>>>> bob. >>>>>>>> >>>>>>>> >>>>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>>>> Hi Bob, >>>>>>>>> >>>>>>>>> You say you know how to tell when it is done. That being the >>>>>>>>> case, to >>>>>>>>> capture the output try adding output redirection to your command. >>>>>>>>> So if your >>>>>>>>> command is MyProgram.exe you could use: >>>>>>>>> >>>>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>>>> >>>>>>>>> If that does not work, post the code you are using. Maybe >>>>>>>>> post it >>>>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>>>> return code. >>>>>>>>> >>>>>>>>> Clifford Bass >>>>>>>>> >>>>>>>>> "Bob Howard" wrote: >>>>>>>>> >>>>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like to >>>>>>>>>> code a >>>>>>>>>> module that executes a "console command", waits for completion, >>>>>>>>>> checks the >>>>>>>>>> return code, and is able to capture the console command's output >>>>>>>>>> (from a >>>>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>>>> >>>>>>>>>> I seem to have it working where I execute the command and wait >>>>>>>>>> for >>>>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>>>> capture the >>>>>>>>>> command's output. >>>>>>>>>> >>>>>>>>>> Any clues?? >>>>>>>>>> >>>>>>>>>> Thanks... >>>>>>>>>> >>>>>>>>>> bob >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >> >> > >
|
|
Yup cmd.exe makes sense. Try this...
shell "cmd /c C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp smtp.gmail.com > c:\gmailoutput.txt 2>%1", vbNormalFocus
This ought to start a new cmd session and pass all of the command line args.
Rdub
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:O7bhJ$VTJHA.1164[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] >I also posted this matter on the Windows newsgroup and received the >following: > > " ... the args are passed to the program to parse. You could try to shell > to > cmd, or write a temporary .bat file" > > So what he's saying is that cmd.exe is responsible for interpreting the > redirect parms ... and obviously cmd.exe is not being executed. > > I'll post results here of my additional testing... > > bob > > "Ron Weiner" <rweineratworksritedotcom> wrote in message > news:%23Z%23nTZRTJHA.5568[ at ]TK2MSFTNGP05.phx.gbl... >> Couple of questions. >> >> Does your user account have permissions to write a file in the root of >> the hard drive. If you are gonna want to run this code under Vista, you >> will want to rething this location. >> >> What the heck is the 2>%1 at the end of the Command line. >> >> What happens if you type that command directly from the command prompt? >> >> Rdub >> >> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >> news:u1QQYDRTJHA.1960[ at ]TK2MSFTNGP04.phx.gbl... >>> Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp >>> smtp.gmail.com >>> >c:\gmailoutput.txt 2>%1", vbNormalFocus >>> >>> >>> (of course, all of the above is on a single line) >>> >>> bob >>> >>> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message >>> news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl... >>>> Let's see the actual VBA code you're using. >>>> >>>> -- >>>> Doug Steele, Microsoft Access MVP >>>> http://I.Am/DougSteele>>>> (no e-mails, please!) >>>> >>>> >>>> >>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>> news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >>>>> Nope --- doesn't work with the pipe.. bob >>>>> >>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>>>>> What happens when you try to redirect the output from a command >>>>>> prompt? >>>>>> >>>>>> You might also want to try Piping the output to a file with the Pipe >>>>>> operator (|). I doubt there'd be any difference but what the heck. >>>>>> Command line would be ... >>>>>> >>>>>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>>>>> >>>>>> If redirection and/or piping does NOT work from a command prompt, >>>>>> then your sucking smelly wind trying to make it work in your Access >>>>>> App. If it does work from a command prompt, but not in your app, show >>>>>> us a few lines of your calling code. >>>>>> >>>>>> Rdub >>>>>> >>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>>>>> Hi again, >>>>>>> >>>>>>> I just tried running it using the standard VBA "Shell" function, and >>>>>>> it does not work (no output produced anywhere). It's as if the >>>>>>> whole command line it being tossed... When I remove the redirection >>>>>>> of the output, it works fine (except the output goes to a DOS-like >>>>>>> Window). >>>>>>> >>>>>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in >>>>>>> the application, and it works fine. >>>>>>> >>>>>>> bob >>>>>>> >>>>>>> >>>>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>>>>> Presumably Mailsend displays it's results to the standard output >>>>>>>> when it has finished doing whatever it does. you can test this by >>>>>>>> running your command line from a command prompt, and see what >>>>>>>> happens. You can capture this content by redirecting the standard >>>>>>>> output to a file using the redirect operator (>). So... from a >>>>>>>> command prompt type something like this... >>>>>>>> >>>>>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>>>>> >>>>>>>> If a file "mytxtfile.txt" is created in the current directory then >>>>>>>> you are good to go. At least this should be easy enough to try. >>>>>>>> >>>>>>>> Rdub >>>>>>>> >>>>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>>>>> BTW, the original command line is: >>>>>>>>> >>>>>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>>>>> >>>>>>>>> Again, I want to execute the above command (executing the program >>>>>>>>> "mailsend.exe") with the parameters as specified (above) and >>>>>>>>> capture the output. I then want to read the output into my >>>>>>>>> program and analyze the result. >>>>>>>>> >>>>>>>>> Thanks again... >>>>>>>>> >>>>>>>>> bob. >>>>>>>>> >>>>>>>>> >>>>>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>>>>> Hi Bob, >>>>>>>>>> >>>>>>>>>> You say you know how to tell when it is done. That being the >>>>>>>>>> case, to >>>>>>>>>> capture the output try adding output redirection to your command. >>>>>>>>>> So if your >>>>>>>>>> command is MyProgram.exe you could use: >>>>>>>>>> >>>>>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>>>>> >>>>>>>>>> If that does not work, post the code you are using. Maybe >>>>>>>>>> post it >>>>>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>>>>> return code. >>>>>>>>>> >>>>>>>>>> Clifford Bass >>>>>>>>>> >>>>>>>>>> "Bob Howard" wrote: >>>>>>>>>> >>>>>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like >>>>>>>>>>> to code a >>>>>>>>>>> module that executes a "console command", waits for completion, >>>>>>>>>>> checks the >>>>>>>>>>> return code, and is able to capture the console command's output >>>>>>>>>>> (from a >>>>>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>>>>> >>>>>>>>>>> I seem to have it working where I execute the command and wait >>>>>>>>>>> for >>>>>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>>>>> capture the >>>>>>>>>>> command's output. >>>>>>>>>>> >>>>>>>>>>> Any clues?? >>>>>>>>>>> >>>>>>>>>>> Thanks... >>>>>>>>>>> >>>>>>>>>>> bob >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >>> >> >> > >
|
|
It works properly, including redirection of the output, when running under the command processor:
Shell "cmd /S /D /C ""the command to be executed and its parameters >outputfile.txt 2>%1""",vbNormalFocus
For an explanation of the /S /D /C switches, please check the Windows command processor documentation...
bob
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:O7bhJ$VTJHA.1164[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] >I also posted this matter on the Windows newsgroup and received the >following: > > " ... the args are passed to the program to parse. You could try to shell > to > cmd, or write a temporary .bat file" > > So what he's saying is that cmd.exe is responsible for interpreting the > redirect parms ... and obviously cmd.exe is not being executed. > > I'll post results here of my additional testing... > > bob > > "Ron Weiner" <rweineratworksritedotcom> wrote in message > news:%23Z%23nTZRTJHA.5568[ at ]TK2MSFTNGP05.phx.gbl... >> Couple of questions. >> >> Does your user account have permissions to write a file in the root of >> the hard drive. If you are gonna want to run this code under Vista, you >> will want to rething this location. >> >> What the heck is the 2>%1 at the end of the Command line. >> >> What happens if you type that command directly from the command prompt? >> >> Rdub >> >> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >> news:u1QQYDRTJHA.1960[ at ]TK2MSFTNGP04.phx.gbl... >>> Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp >>> smtp.gmail.com >>> >c:\gmailoutput.txt 2>%1", vbNormalFocus >>> >>> >>> (of course, all of the above is on a single line) >>> >>> bob >>> >>> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message >>> news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl... >>>> Let's see the actual VBA code you're using. >>>> >>>> -- >>>> Doug Steele, Microsoft Access MVP >>>> http://I.Am/DougSteele>>>> (no e-mails, please!) >>>> >>>> >>>> >>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>> news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >>>>> Nope --- doesn't work with the pipe.. bob >>>>> >>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>>>>> What happens when you try to redirect the output from a command >>>>>> prompt? >>>>>> >>>>>> You might also want to try Piping the output to a file with the Pipe >>>>>> operator (|). I doubt there'd be any difference but what the heck. >>>>>> Command line would be ... >>>>>> >>>>>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>>>>> >>>>>> If redirection and/or piping does NOT work from a command prompt, >>>>>> then your sucking smelly wind trying to make it work in your Access >>>>>> App. If it does work from a command prompt, but not in your app, show >>>>>> us a few lines of your calling code. >>>>>> >>>>>> Rdub >>>>>> >>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>>>>> Hi again, >>>>>>> >>>>>>> I just tried running it using the standard VBA "Shell" function, and >>>>>>> it does not work (no output produced anywhere). It's as if the >>>>>>> whole command line it being tossed... When I remove the redirection >>>>>>> of the output, it works fine (except the output goes to a DOS-like >>>>>>> Window). >>>>>>> >>>>>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in >>>>>>> the application, and it works fine. >>>>>>> >>>>>>> bob >>>>>>> >>>>>>> >>>>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>>>>> Presumably Mailsend displays it's results to the standard output >>>>>>>> when it has finished doing whatever it does. you can test this by >>>>>>>> running your command line from a command prompt, and see what >>>>>>>> happens. You can capture this content by redirecting the standard >>>>>>>> output to a file using the redirect operator (>). So... from a >>>>>>>> command prompt type something like this... >>>>>>>> >>>>>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>>>>> >>>>>>>> If a file "mytxtfile.txt" is created in the current directory then >>>>>>>> you are good to go. At least this should be easy enough to try. >>>>>>>> >>>>>>>> Rdub >>>>>>>> >>>>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>>>>> BTW, the original command line is: >>>>>>>>> >>>>>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>>>>> >>>>>>>>> Again, I want to execute the above command (executing the program >>>>>>>>> "mailsend.exe") with the parameters as specified (above) and >>>>>>>>> capture the output. I then want to read the output into my >>>>>>>>> program and analyze the result. >>>>>>>>> >>>>>>>>> Thanks again... >>>>>>>>> >>>>>>>>> bob. >>>>>>>>> >>>>>>>>> >>>>>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>>>>> Hi Bob, >>>>>>>>>> >>>>>>>>>> You say you know how to tell when it is done. That being the >>>>>>>>>> case, to >>>>>>>>>> capture the output try adding output redirection to your command. >>>>>>>>>> So if your >>>>>>>>>> command is MyProgram.exe you could use: >>>>>>>>>> >>>>>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>>>>> >>>>>>>>>> If that does not work, post the code you are using. Maybe >>>>>>>>>> post it >>>>>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>>>>> return code. >>>>>>>>>> >>>>>>>>>> Clifford Bass >>>>>>>>>> >>>>>>>>>> "Bob Howard" wrote: >>>>>>>>>> >>>>>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like >>>>>>>>>>> to code a >>>>>>>>>>> module that executes a "console command", waits for completion, >>>>>>>>>>> checks the >>>>>>>>>>> return code, and is able to capture the console command's output >>>>>>>>>>> (from a >>>>>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>>>>> >>>>>>>>>>> I seem to have it working where I execute the command and wait >>>>>>>>>>> for >>>>>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>>>>> capture the >>>>>>>>>>> command's output. >>>>>>>>>>> >>>>>>>>>>> Any clues?? >>>>>>>>>>> >>>>>>>>>>> Thanks... >>>>>>>>>>> >>>>>>>>>>> bob >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >>> >> >> > >
|
|
See whether
Call Shell Environ("ComSpec") & "/c C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp smtp.gmail.com >c:\gmailoutput.txt 2>%1", vbNormalFocus)
works.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please)
"Bob Howard" <info[ at ]churchtrax.com> wrote in message news:O7bhJ$VTJHA.1164[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text] >I also posted this matter on the Windows newsgroup and received the >following: > > " ... the args are passed to the program to parse. You could try to shell > to > cmd, or write a temporary .bat file" > > So what he's saying is that cmd.exe is responsible for interpreting the > redirect parms ... and obviously cmd.exe is not being executed. > > I'll post results here of my additional testing... > > bob > > "Ron Weiner" <rweineratworksritedotcom> wrote in message > news:%23Z%23nTZRTJHA.5568[ at ]TK2MSFTNGP05.phx.gbl... >> Couple of questions. >> >> Does your user account have permissions to write a file in the root of >> the hard drive. If you are gonna want to run this code under Vista, you >> will want to rething this location. >> >> What the heck is the 2>%1 at the end of the Command line. >> >> What happens if you type that command directly from the command prompt? >> >> Rdub >> >> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >> news:u1QQYDRTJHA.1960[ at ]TK2MSFTNGP04.phx.gbl... >>> Shell "C:\Martureo.Org\ChurchTrax\mailsend.exe -info -smtp >>> smtp.gmail.com >>> >c:\gmailoutput.txt 2>%1", vbNormalFocus >>> >>> >>> (of course, all of the above is on a single line) >>> >>> bob >>> >>> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message >>> news:eIwaujQTJHA.4456[ at ]TK2MSFTNGP05.phx.gbl... >>>> Let's see the actual VBA code you're using. >>>> >>>> -- >>>> Doug Steele, Microsoft Access MVP >>>> http://I.Am/DougSteele>>>> (no e-mails, please!) >>>> >>>> >>>> >>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>> news:%23RdAm9PTJHA.5192[ at ]TK2MSFTNGP05.phx.gbl... >>>>> Nope --- doesn't work with the pipe.. bob >>>>> >>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>> news:e2oZZwNTJHA.3880[ at ]TK2MSFTNGP04.phx.gbl... >>>>>> What happens when you try to redirect the output from a command >>>>>> prompt? >>>>>> >>>>>> You might also want to try Piping the output to a file with the Pipe >>>>>> operator (|). I doubt there'd be any difference but what the heck. >>>>>> Command line would be ... >>>>>> >>>>>> mailsend.exe -info -smtp smtp.gmail.com | mytxtfile.txt >>>>>> >>>>>> If redirection and/or piping does NOT work from a command prompt, >>>>>> then your sucking smelly wind trying to make it work in your Access >>>>>> App. If it does work from a command prompt, but not in your app, show >>>>>> us a few lines of your calling code. >>>>>> >>>>>> Rdub >>>>>> >>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>> news:%23onIIgMTJHA.1164[ at ]TK2MSFTNGP03.phx.gbl... >>>>>>> Hi again, >>>>>>> >>>>>>> I just tried running it using the standard VBA "Shell" function, and >>>>>>> it does not work (no output produced anywhere). It's as if the >>>>>>> whole command line it being tossed... When I remove the redirection >>>>>>> of the output, it works fine (except the output goes to a DOS-like >>>>>>> Window). >>>>>>> >>>>>>> BTW, I use the ShellWait function (from Terry Kreft) elsewhere in >>>>>>> the application, and it works fine. >>>>>>> >>>>>>> bob >>>>>>> >>>>>>> >>>>>>> "Ron Weiner" <rweineratworksritedotcom> wrote in message >>>>>>> news:OlORHkLTJHA.1144[ at ]TK2MSFTNGP05.phx.gbl... >>>>>>>> Presumably Mailsend displays it's results to the standard output >>>>>>>> when it has finished doing whatever it does. you can test this by >>>>>>>> running your command line from a command prompt, and see what >>>>>>>> happens. You can capture this content by redirecting the standard >>>>>>>> output to a file using the redirect operator (>). So... from a >>>>>>>> command prompt type something like this... >>>>>>>> >>>>>>>> mailsend.exe -info -smtp smtp.gmail.com > mytxtfile.txt >>>>>>>> >>>>>>>> If a file "mytxtfile.txt" is created in the current directory then >>>>>>>> you are good to go. At least this should be easy enough to try. >>>>>>>> >>>>>>>> Rdub >>>>>>>> >>>>>>>> "Bob Howard" <info[ at ]churchtrax.com> wrote in message >>>>>>>> news:eoddIcLTJHA.4504[ at ]TK2MSFTNGP02.phx.gbl... >>>>>>>>> BTW, the original command line is: >>>>>>>>> >>>>>>>>> mailsend.exe -info -smtp smtp.gmail.com >>>>>>>>> >>>>>>>>> Again, I want to execute the above command (executing the program >>>>>>>>> "mailsend.exe") with the parameters as specified (above) and >>>>>>>>> capture the output. I then want to read the output into my >>>>>>>>> program and analyze the result. >>>>>>>>> >>>>>>>>> Thanks again... >>>>>>>>> >>>>>>>>> bob. >>>>>>>>> >>>>>>>>> >>>>>>>>> "Clifford Bass" <CliffordBass[ at ]discussions.microsoft.com> wrote in >>>>>>>>> message news:7BC51BD7-BFAF-4484-A10B-73EE7A709BA5[ at ]microsoft.com... >>>>>>>>>> Hi Bob, >>>>>>>>>> >>>>>>>>>> You say you know how to tell when it is done. That being the >>>>>>>>>> case, to >>>>>>>>>> capture the output try adding output redirection to your command. >>>>>>>>>> So if your >>>>>>>>>> command is MyProgram.exe you could use: >>>>>>>>>> >>>>>>>>>> MyProgram.exe > "C:\MyProgram's Output.txt" >>>>>>>>>> >>>>>>>>>> If that does not work, post the code you are using. Maybe >>>>>>>>>> post it >>>>>>>>>> anyway, then maybe I or someone else can tell you how to get the >>>>>>>>>> return code. >>>>>>>>>> >>>>>>>>>> Clifford Bass >>>>>>>>>> >>>>>>>>>> "Bob Howard" wrote: >>>>>>>>>> >>>>>>>>>>> Running A2K3 (under either W2K, W/XP or W/Vista), I would like >>>>>>>>>>> to code a >>>>>>>>>>> module that executes a "console command", waits for completion, >>>>>>>>>>> checks the >>>>>>>>>>> return code, and is able to capture the console command's output >>>>>>>>>>> (from a >>>>>>>>>>> disc file somewhere) to read it back in and analyze the results. >>>>>>>>>>> >>>>>>>>>>> I seem to have it working where I execute the command and wait >>>>>>>>>>> for >>>>>>>>>>> completion. But I'm not sure how to check the return code or >>>>>>>>>>> capture the >>>>>>>>>>> command's output. >>>>>>>>>>> >>>>>>>>>>> Any clues?? >>>>>>>>>>> >>>>>>>>>>> Thanks... >>>>>>>>>>> >>>>>>>>>>> bob >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>> >>> >> >> > >
|
|
|