Sign in to follow this  
Followers 0
Ibrahim

Share Watcher

11 posts in this topic

#1 ·  Posted (edited)

Checks your state and tells u if someone is using ur shares,should be usefull,I used the net session command and the help of Smashy

#include <Process.au3>
#Include <Constants.au3>
#include <File.au3>
while @error=0
    sleep(5000)
_RunDos("Net session >c:\session.bin")
;~ MsgBox(0,"intruders",FileRead("c:\session.bin"))
$No=_FileCountLines ("c:\session.bin")

if $No > 4 Then
for $count=5 to $No-2
    $read=FileReadLine("c:\session.bin",$count)
    $read=StringTrimLeft($read,2)
    $read=StringReplace($read,"            ",")) Username: ",1)
    $read=StringReplace($read,"               ","   OS #",2)
    $read=StringTrimRight($read,19)
TrayTip("Share REsource Opened","By: (("&$read,2,2)
sleep(2000)

    Next
FileDelete("c:\session.bin");;;;;;;;;;;;;;;<<<<<<<<<---------Added this line to return to normal when there is no entries(My Mistake Actually)
EndIf
WEnd

Feel free to edit it and add Menu Items and stuff I'm Already on that

post-22904-1192097238_thumb.jpg

post-22904-1192109751_thumb.jpg

Edited by Ibrahim

Share this post


Link to post
Share on other sites



Thought about using StdoutRead rather than writing to a file?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Seems pretty neat... nice work!


[center][/center]

Share this post


Link to post
Share on other sites

NOw that's progress, but i guess i need to make a total make over with menus and stuff ,but is it usefull or not?

Yes, very usefull.

Thank you very much

Peppe

Share this post


Link to post
Share on other sites

I asked for this 2 days ago in Chat!! I just had no idea how to do it myself.

This is awesome! Let me make some modifications and I'll have it running all the time. :)

Thanks!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I threw together the ones you just wrote..

hope you like the code change,

have a nice day!

#include <constants.au3>

while 1

_TrayTipMe("NET"     , "Net session"                                                                                                    , @SW_HIDE)
_TrayTipMe("ARP"     , "Arp -a"                                                                                                         , @SW_HIDE)
_TrayTipMe("NSLOOKUP", 'nslookup %computername%'                                                                                        , @SW_HIDE)
_TrayTipMe("IPCONFIG", 'echo off & for /F "usebackq tokens=1-15 delims= " %a in (`ipconfig /all ^| find /I "IP Address"`) do echo %o'   , @SW_HIDE)
WEnd

Func _TrayTipMe($strInfo, $StrCommand, $Hide)
; Traytip any BATCH Command
; custom Title per Command
; option to hide outputbox
    $PID = Run(@ComSpec & " /c " & $StrCommand, @scriptdir, $Hide, $STDERR_CHILD + $STDOUT_CHILD)
    $List = StdoutRead($PID, -1)
    TrayTip("",$strInfo & @CRLF & $List,4,2)
    Sleep(1500)
    $StrCommand = ""
EndFunc
Edited by lordofthestrings

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

First of all the code is great when using as a function call

BUT,There is no Onevent Action here, it's not about displaying the entries it's about getting them when changed

thanks u r gr8

Edited by Ibrahim

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Guys Take a look at Manadar's Version It's more EFFECIENT

http://www.autoitscript.com/forum/index.php?showtopic=54957

He Did say my name ---->>>I'm Happy !!!

And So I guess somebody shoud put this in the "Not the Example Section"

Edited by Ibrahim

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