RogerRabbitsClone Posted September 8, 2010 Share Posted September 8, 2010 hello autoiters, so heres my goal. i want to get ip address from the computer running this scritp and have it sent to my email. heres what i have so far. this is the getting the info part: Func ipconfig($lookfor = "DNS Servers") $cmd = Run(@Comspec & " /c ipconfig /all", "" , @SW_HIDE, 2+4) $Result = "" While 1 $line = StdoutRead($cmd) If @error Then Return "Error" if StringInStr($line,$lookfor) then ExitLoop WEnd $Data = StringSplit(StringStripWS($line,7),$lookfor,1) $Data = StringSplit($Data[2],":",1) $Data = StringStripWS($Data[2],7) ConsoleWrite (@CR & $lookfor & "=" &$Data) Return $Data endfunc(i didnt write this, i got it from the forums) this is the sending to email part: ShellExecute ("cmd") send ("telnet") send ("{enter}") sleep (300) send ("open gmail-smtp-in.l.google.com 25") send ("{enter}") sleep(300) send ("ehlo") send ("{enter}") sleep (300) send ("MAIL FROM:<DNSinfo@DNSinfo.com>") send ("{enter}") sleep (300) send ("RCPT TO:<myemail@gmail.com>") send ("{enter}") sleep (1000) send ("DATA") send ("{enter}") i know using send is extremely buggy and i would rather do it the correct way, but im having trouble figuring out what the correct way would be.. should i be doing something like: run ("/c telnet gmail-smtp-in.l.google.com 25") consolewrite ("ehlo MAIL FROM:<DNSinfo@DNSinfo.com>") what exactly is the correct way to send commands to cmd? or should i just write a batch file and use fileinstall? thanks <--a good way to start you day Link to comment Share on other sites More sharing options...
KaFu Posted September 8, 2010 Share Posted September 8, 2010 Hu, SF Bay Area, I've been there Thursday to Saturday ...A look at my Pipe to @ComSpec example might reveal what you're looking for. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
RogerRabbitsClone Posted September 8, 2010 Author Share Posted September 8, 2010 ok...im having trouble understanding this. please bear with me, so if i wanted to open cmd, and send it commands, i would do it like this? $foo = Run(@ComSpec & " command1 && command2 && command3 && Exit", 'c:\', $STDOUT_CHILD) $line = "" While 1 $line &= StdoutRead($foo) If @error Then ExitLoop Wend MsgBox(0,"","Finished" & @crlf & @crlf & @crlf & $line) im having a hard time following this, i want to blame it on being up since 4am, but its probably just ignorance. <--a good way to start you day Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 8, 2010 Share Posted September 8, 2010 (edited) Uhmm... how about just: $Data = @IPAddress1 Edit: I note the function you found pulls the DNS address by default, but you did say you wanted the IP. Edited September 8, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now