caramen

Send $Value Error

18 posts in this topic

Hello guys.

I have got this script

$iPid = run("Powershell Get-ADUser "&$UserNameReaded&" -Properties * | select -Expand EmailAddress"  , @WindowsDir , @SW_HIDE , 0x2)
$MailUser = ""

 While 1
    $MailUser &= StdoutRead($iPID)
        If @error Then
            ExitLoop
        EndIf
 WEnd
GUICtrlSetData ($Label015, ""&$MailUser)
If $MailUser = "" Then GUICtrlSetData ($Label017 , "N/A"&$MailUser)

Everything is working fine i got correct value

For my account the value is for exemple :

J.Personnal@Enterprise.com

in the $Label017 the value is correct i have still

J.Personnal@Enterprise.com

If i use :

Send (""&$MailUser)

i have now :

J.Personnalnterprise.com

Is there a way to correct this ?

Share this post


Link to post
Share on other sites



Do you have any Options set i.e. Opt("ExpandVarStrings", 1)?

Share this post


Link to post
Share on other sites

Send() has an optional parameter (flag). You could try setting it to 1.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@Subz Hi and thx for answer I got 0 option set should i try the one you suggested ?

@Danp2 Hi and ty for answer Can you send me the exact Opt ?

Edited by caramen

Share this post


Link to post
Share on other sites
2 hours ago, caramen said:

Can you send me the exact Opt ?

Read the help file. ;-)

Share this post


Link to post
Share on other sites

To interact with Active Directory I suggest you use my AD UDF. Much faster than to run PowerShell and the results are returned in an array or variable :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

 

@Danp2 I already tryed to find ofc... I am gonna watch again.

@water I am using your UDF also for account password reset and unlocking account. i like how the script work atm so i wont change it. There is about 1500 lines to change if i use UDF.

I use your AD UDF

I also use your Outlook udf but i cant figure out how to make a signature corectly with it. But i dont want to pm you becose it s forbiden.
i also use your Word UDF xD... in the same script.. no probleme with it.. and one like. ;p

Edited by caramen

Share this post


Link to post
Share on other sites

Does the OutlookEX example script _OL_SignatureCreate.au3 work for you or do you get errors?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I tryed 3 opt and it still does not working.

I need the @ :(

Opt("ExpandVarStrings", 1)
Opt ("SendAttachMode", 1)
Opt ("SendCapslockMode", 1)

Share this post


Link to post
Share on other sites

#10 ·  Posted

Remove the Opts and as Danp2 pointed out try using:

Send (""&$MailUser, 1)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

@Subz Ahhh ok this is the optional flag .

ok i tryed it and it s still not working. i tryed

Send (""&$MailUser, 0)

Send (""&$MailUser, 1)

The send is still sending the value without the @

Edited by caramen

Share this post


Link to post
Share on other sites

#12 ·  Posted

Which application do you send $MailUser to?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#13 ·  Posted

@water Word

Share this post


Link to post
Share on other sites

#14 ·  Posted

@caramen Just tried the script it's extremely slow compared to AD UDF, but it does work and sends to Word fine with @ sign, just one thing to note that you should use StringStripWS($MailUser, 8) as it appears to include @CRLF or @LF in the returned value, I don't think this should have any impact though on the issue you're encountering.

Share this post


Link to post
Share on other sites

#15 ·  Posted

Why not use the Word UDF?
OutlookEX comes with an example how to create a signature using Word. Please check _OL_MailSignatureCreate.au3


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#16 ·  Posted

@Subz It is slow only one time at the beginning of the script it s gonna use all the value after that for a long sequence so it s not a problem

Yeah i noticed about the @crlf @lf i use 4 x {BS} and pixel search for exact positionning.

 

@water I already said you i am not able to use the _OL_MailSignatureCreate becose i am not understunding it. nothing about the script. I whould use it if i was able to. But now my entire script is working exept that line with the @ so i whould be happy to get that line working :).

 

What it can be if it work for you ?

what are the prerequisites to send all key normaly ?

 

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

I've read your post and understand what you are telling me. But I still think it doesn't make sense and is not very reliable to use Send to create a signature.
If you could post a screenshot of a signature you like to create (or send me via PM) I would be happy to give it a try using Outlook and Word.

 

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#18 ·  Posted

We already solved the signature problems via PM :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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

  • Similar Content

    • spuuunit
      By spuuunit
      This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code:
      While WinActive(" - Mozilla Firefox") If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then $timer = TimerInit() While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) $diff = TimerDiff($timer) If $diff > 200 Then Send("^{T}") While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) WEnd EndIf WEnd EndIf WEnd The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.
    • Baboo85
      By Baboo85
      Hi all,
      I need to start a script that include:
      - admin privileges
      - multiple cmd commands
      - no bat, no exe, no tmp files created anywhere (especially in the user temp folder)
      In a bat file it would be simple, but users shouldn't see what commands I'm sending.
      Example of the script:
      echo off cls echo. echo I AM A TOOL echo. echo NOTE: echo - note 1 echo - note 2 echo - etc set USER1=0 set COMPUTER1=0 if /i %username% equ user.user ( set USER1=1 set COMPUTER1=1 ) if /i %username% equ another.user set USER1=1 if /i %computername% equ notebook set COMPUTER1=1 if %USER1% EQU 1 ( if %COMPUTER1% EQU 1 ( reg delete "HKLM\SOFTWARE\blablabla" /f ) else ( echo Computer not authorized. Contact assistance.) ) else ( echo User not authorized. Contact assistance.) echo. pause exit With the send("") is a disaster.
      I'm a noob here, so what can I do?
       
      EDIT: OR ELSE I explain the situation and what I need, so if there is a simple solution I can use that.
       
      SITUATION: our domain users have Users rights on the machine. Some of them need administrator rights.
      We create a local user with administrator rights, so that the users must insert username and password when asked to run something with administrator rights.
      We have an internal domain group policy that blocks EXE, BAT, COM, TMP files from the user local temp directory, for a security reason (malware). That also blocks most software installation.
      But some users are often out of office, away from workplace and in another country, they need a complete control on their computers.
       
      WHAT I NEED: I need to check the username and the computer name. If the username is the one with local administrator rights and the computer name is a computer that is qualified to temporary remove the policy, then I need to execute a REG DELETE command with administrator rights.
       
      I hope I explained myself.
       
      Thank you very much.
    • Jefrey
      By Jefrey
      I've made this HTTP lib to simplify HTTP requests, mainly when dealing about POST data or file uploads.
      Three functions are available:
      string _HTTP_Get ( string $sURL ) string _HTTP_Post ( string $sURL , string $sPostData ) string _HTTP_Upload ( string $sURL , string $sFilePath , string $sFileField , string $sPostData = '' , string $sFilename = Default) Additionaly, two helper functions are also available:
      URLEncode($sStr) URLDecode($sStr) Full documentation: https://github.com/jesobreira/HTTP.au3/blob/master/README.md
      Fork me on Github: https://github.com/jesobreira/HTTP.au3
      Download lib + docs: https://github.com/jesobreira/HTTP.au3/archive/master.zip
    • darkangel37
      By darkangel37
      hello im trying to automate random greetings word from .txt file  and write/send some strings but it gives me error
      please be gentle to me im kinda newbie thank you
      $File = FileReadToArray("words.txt") $RandomWords = $File[Random(0, UBound($File) - 1, 1)] send ("$RandomWords") sleep (1000) send ("{enter}")
       
    • OrangeCoder
      By OrangeCoder
      Hey Guys - I am trying to write a very simple script that just types a value into ONE field and presses and next
      That's it!
      Here is what I am trying to do:
      I have a software product that used Installshield to package it - I wrote a response file per installshield directions /  for the software and it automated almost everything except one window... sadly the company that makes the software doesn't want to help, installshield won't help since I don't have a license . So I am trying to write and autoit script to fill in the one window that doesn't get recorded in the response file to finish the installation
      My write activated the window but when I follow it with a send() it doesn't work
       
      here is what I have
      WinActivate("Server Information") Send("xx-xxx-xx") Send("!n") Send("{SPACE}") any ideas ?