Tech Tip!

Question:

On UniVerse/unix I can use the SH command to execute operating system commands, but  I'm not able to find anything about performing OS commands from the UniVerse/Windows platform. There must be a way to do this. Specifically, I'm trying to call blat.exe from a UniBasic program to send an email.

Answer:

There are actually two ways to do this.

The first, you can call out using a DOS command thus:

DOS /C your_command

If the command is also an executable you can set a direct verb pointer,

CT VOC BLAT
>CT VOC BLAT

BLAT
0001 V
0002 blat.exe
0003 U

Here's a snippet on how I use it:

* first write the text of the message onto the current directory as a .txt file ..
Write Text On UFD,Id:".txt"

* then call BLAT as a verb

ExLine = "BLAT ":Id:".txt"
ExLine := " -to ":Email
ExLine := ' -s "':Subject:'"'
ExLine := ' -p my_profile'
Execute ExLine CAPTURING OUT

NOTE that I'm using a named profile to store the configuration details. You need to do that (or provide them all on the command line which is a nice security hole) since each UV session runs under the credentials of the login user, and BLAT stores its profiles on a per-user basis.

Answer supplied on www.u2ug.org Technical Posting forum:

http://212.241.202.162/cms/cmsforum.wsp?action=topic&forum=6&topic=171

menu
menu