Sign in to follow this  
Followers 0
jay

Passing Variables to Blat.exe Commandline

20 posts in this topic

#1 ·  Posted (edited)

Can someone help me with the syntax on the line below or show me where i can learn it.

Run("blat.exe", "-serverSMTP", $SMTPADD, "-s" $SUBJECT, "-body" $BODY, "-u" $USERNAME, "-pw" $PASSWORD, "-t" $TO )

Edited by jay

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Can someone help me with the syntax on the line below or show me where i can learn it.

Run("blat.exe", "-serverSMTP", $SMTPADD, "-s" $SUBJECT, "-body" $BODY, "-u" $USERNAME, "-pw" $PASSWORD, "-t" $TO )

Maybe i am getting closer to solveing this

Run("blat.exe", "", "-serverSMTP" & $SMTPADD & "-s" & $SUBJECT & "-body" & $BODY & "-u" & $USERNAME & "-pw" & $PASSWORD & "-t" & $TO )

I just wish i could see what it is passing to the cmd line

Edited by jay

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

like this

MsgBox(0,"Test", "-serverSMTP" & $SMTPADD & "-s" & $SUBJECT & "-body" & $BODY & "-u" & $USERNAME & "-pw" & $PASSWORD & "-t" & $TO)

EDIT: fixed

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

like this

MsgBox(0,"Test", "-serverSMTP" & $SMTPADD & "-s" & $SUBJECT & "-body" & $BODY & "-u" & $USERNAME & "-pw" & $PASSWORD & "-t" & $TO)

EDIT: fixed

8)

Its getting numbers instead of the strings

; example 1

#include <GUIConstants.au3>

GUICreate("Email GUI App") ; will create a dialog box that when displayed is centered

;INIREAD ---------------------------------------------------

$Ini = "guiemail.ini"

$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")

$Ini = "guiemail.ini"

$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")

$Ini = "guiemail.ini"

$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")

$Ini = "guiemail.ini"

$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")

$Ini = "guiemail.ini"

$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")

$Ini = "guiemail.ini"

$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")

$Ini = "guiemail.ini"

$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

GUICtrlCreateLabel ("SMTP ADDRESS:", 2, 12, 100, 100, -1, -1)

$SMTPADD = GUICtrlCreateInput($SMTP, 100, 10, 150, 20)

GUICtrlCreateLabel ("USERNAME:", 2, 38, 100, 100, -1, -1) ;+26

$USERNAME = GUICtrlCreateInput ($UNAME, 100, 35, 150, 20) ;+25

GUICtrlCreateLabel ("PASSWORD:", 2, 64, 100, 100, -1, -1)

$PASSWORD = GUICtrlCreateInput ($pword, 100, 60, 150, 20)

GUICtrlCreateLabel ("TO:", 2, 90, 100, 100, -1, -1)

$TO = GUICtrlCreateInput ($TOWHO, 100, 85, 150, 20)

GUICtrlCreateLabel ("FROM:", 2, 116, 100, 100, -1, -1)

$FROM = GUICtrlCreateInput ($FROMWHO, 100, 110, 150, 20)

GUICtrlCreateLabel ("SUBJECT:", 2, 142, 100, 100, -1, -1)

$SUBJECT = GUICtrlCreateInput ($SUBWHO, 100, 135, 150, 20)

GUICtrlCreateLabel ("BODY:", 2, 168, 100, 100, -1, -1)

$BODY = GUICtrlCreateInput ($BODYWHO, 100, 160, 150, 150, $ES_MULTILINE)

$SEND = GUICtrlCreateButton ("SEND", 203, 325, 50, 20)

$SAVE = GUICtrlCreateButton ("SAVE", 152, 325, 50, 20)

$CLOSE = GUICtrlCreateButton ("CLOSE", 100, 325, 50, 20)

GUISetState (@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $CLOSE Then ExitLoop

If $msg = $SEND Then

Run("blat.exe", "", "-serverSMTP" & $SMTPADD & "-s" & $SUBJECT & "-body" & $BODY & "-u" & $USERNAME & "-pw" & $PASSWORD & "-t" & $TO )

MsgBox(0,"Test", "-serverSMTP" & $SMTPADD & "-s" & $SUBJECT & "-body" & $BODY & "-u" & $USERNAME & "-pw" & $PASSWORD & "-t" & $TO)

;this returns -serverSMTP4-s14-body-16-u6-pw8-t10

;When it should be blat.exe -serverSMTP somewhere.org -s Falcon -body Falcon Problem -u username -pw password -t someone@somewhere.com

EndIf

If $msg = $SAVE Then

;INIWRITE ---------------------------------------------------

IniWrite($Ini, "section1", "SMTP", GUICtrlRead($SMTPADD ))

IniWrite($Ini, "section1", "USERNAME", GUICtrlRead($USERNAME))

IniWrite($Ini, "section1", "PASSWORD", GUICtrlRead($PASSWORD))

IniWrite($Ini, "section1", "TO", GUICtrlRead($TO))

IniWrite($Ini, "section1", "FROM", GUICtrlRead($FROM))

IniWrite($Ini, "section1", "SUBJECT", GUICtrlRead($SUBJECT))

IniWrite($Ini, "section1", "BODY", GUICtrlRead($BODY))

;INIWRITE ---------------------------------------------------

EndIf

Wend

Edited by jay

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

First you need to "READ" each input

like this

$Message = "-serverSMTP" & (GUICtrlRead($SMTPADD)) & ....

Run("blat.exe", "", $Message )

8)

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Run("blat.exe -serverSMTP """ & $SMTPADD & """ -s """ & $SUBJECT & """ -body """ & $BODY & """ -u """ & $USERNAME & """ -pw """ & $PASSWORD & """ -t """ & $TO & """")

extra space and quotes required to get the format used in blat.exe

i think ;)


i think

Share this post


Link to post
Share on other sites

First you need to "READ" each input

like this

$Message = "-serverSMTP" & (GUICtrlRead($SMTPADD)) & ....

Run("blat.exe", "", $Message )

8)

8)

Do i need to read the input in the send section of the script?

And thanks fr your help

Jay

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

extra space and quotes required to get the format used in blat.exe

i think ;)

well this started blat but i still cant dont see what is be passed to the var for it

Jay

Edited by jay

Share this post


Link to post
Share on other sites

If $msg = $SEND Then

$Message = "-serverSMTP" & (GUICtrlRead($SMTPADD)) & .......

Run("blat.exe", "",$Message)

MsgBox(0,"Test", $Message)

EndIf

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

well this started blat but i still cant dont see what is be passed to the var for it

Jay

adding GUICtrlRead before each variables might help

i think ;)


i think

Share this post


Link to post
Share on other sites

You can modify this also

;INIREAD ---------------------------------------------------

Dim $Ini = "guiemail.ini"
$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")
$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")
$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")
$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")
$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")
$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")
$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

you only need to say $Ini = .....

one time

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

You can modify this also

;INIREAD ---------------------------------------------------

Dim $Ini = "guiemail.ini"
$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")
$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")
$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")
$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")
$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")
$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")
$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

you only need to say $Ini = .....

one time

8)

Can you give an example?

Thanks

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Do i need to read the input in the send section of the script?

And thanks fr your help

Jay

$Message = "-serverSMTP" & (GUICtrlRead($SMTPADD)) & "-s" & (GUICtrlRead($SUBJECT)) & "-body" & (GUICtrlRead($BODY)) & "-u" & (GUICtrlRead($USERNAME)) & "-pw" & (GUICtrlRead($PASSWORD)) & "-t" & (GUICtrlRead($TO)) )

MsgBox(0,"Test11", $Message)

Run("blat.exe", "",$Message)

This i what i got from your post but i think i got it wrong ;)

Edited by jay

Share this post


Link to post
Share on other sites

try the "Double quotes" like DiskAI stated above...

and with the message box you should be able to see your spacing...

and the ini write above is the example

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

try the "Double quotes" like DiskAI stated above...

and with the message box you should be able to see your spacing...

and the ini write above is the example

8)

I think my problem now it the this

Run("blat.exe", "", $Message)

It does not seem to be attemping to Run Blat.exe and its in the directory..

Share this post


Link to post
Share on other sites

help states this

Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] )

Parameters

filename The name of the executable (EXE, BAT, COM, or PIF) to run.

workingdir [optional] The working directory.

flag [optional] The "show" flag of the executed program:

@SW_HIDE = Hidden window

@SW_MINIMIZE = Minimized window

@SW_MAXIMIZE = Maximized window

standard_i/o_flag [optional] Provide a meaningful handle to one or more STD I/O streams of the child process.

1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream

2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream

4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream

so... maybe you need to do this

Run(@ScriptDir & "\blat.exe " & $Message)

i have never used blat

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Edit: Valuater beat me to it....

I think that the syntax for Run has been in error for each of the posts to this thread thus far.

Run("blat.exe", "", $Message)

Run("filename", "workingdir", flag)

Try

Run("blat.exe " & $Message, "workingdir", flag)

or just

Run("blat.exe " & $Message)

Or maybe I don't understand what you are attempting....

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

help states this

Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] )

Parameters

filename The name of the executable (EXE, BAT, COM, or PIF) to run.

workingdir [optional] The working directory.

flag [optional] The "show" flag of the executed program:

@SW_HIDE = Hidden window

@SW_MINIMIZE = Minimized window

@SW_MAXIMIZE = Maximized window

standard_i/o_flag [optional] Provide a meaningful handle to one or more STD I/O streams of the child process.

1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream

2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream

4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream

so... maybe you need to do this

Run(@ScriptDir & "\blat.exe " & $Message)

i have never used blat

8)

Ok i am getting closer how can i get it to keep the Quotes around the Text Example "SMTP.SERVER" its coming out like this instead SMTP.SERVER i need the quotes to stay...

Share this post


Link to post
Share on other sites

Ok i am getting closer how can i get it to keep the Quotes around the Text Example "SMTP.SERVER" its coming out like this instead SMTP.SERVER i need the quotes to stay...

Maybe its working now I just got a email

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0