Sign in to follow this  
Followers 0
youknowwho4eva

Send message to networked computer

8 posts in this topic

I'm just wondering if this is possible. I want to put a program on a network pc, that when someone adds a file or modifies a file it pops up a message on their screen that says such and such has been added to the network drive. It will be allowed to be on this drive for so many days. If it is not modified or removed by such date, it will be removed. Here's the kicker. I don't want an external program on their computer. What I'm thinking is if it's possible it would be by getting their ip and somehow sending them a message that way. If all else fails I can always make the computer email them.


Giggity

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I'm just wondering if this is possible. I want to put a program on a network pc, that when someone adds a file or modifies a file it pops up a message on their screen that says such and such has been added to the network drive. It will be allowed to be on this drive for so many days. If it is not modified or removed by such date, it will be removed. Here's the kicker. I don't want an external program on their computer. What I'm thinking is if it's possible it would be by getting their ip and somehow sending them a message that way. If all else fails I can always make the computer email them.

Hi there,

Sometime ago i wrote this script and i never finished, it can be a start :mellow:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.1
 Author:         November

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
;Includes

#include <file.au3>
#include <array.au3>

;Strings
Dim $lastscan, $teste, $text, $listcurrentfiles

$status = ""
$text = ""
$teste = 0
$sharepath = "\\server\folder"
$tempdir = @TempDir & "\check.lfu"
$errorfla = "No error"

$checktempfile = FileExists($tempdir)

Select
    case $checktempfile = 1
;TrayTip ("Error", "File exists : " & $tempdir, 5)      
        Scandif()
    case $checktempfile = 0
;TrayTip ("Error", "File not exists : " & $tempdir, 5)
        TrayTip("Scanning", "Reading files. Fist use or support file deleted.", 5)
        _FileCreate($tempdir)
        listfiles()
EndSelect

func listfiles()

$listcurrentfiles = _FileListToArray($sharepath)

if @error Then
    Select
        case @error = 1
            $errorfla = "Error 1 : Path not found."
        Case @error = 4
            $errorfla = "Error 4 : No files found in path."
    EndSelect
    TrayTip ("Error", $errorfla, 5)
else 
    _FileWriteFromArray($tempdir, $listcurrentfiles, 1, 0)
;MsgBox(0, "teste", $tempdir)
    sleep(5000)
EndIf

EndFunc

func Scandif()

$listcurrentfiles = _FileListToArray($sharepath)
_FileReadToArray($tempdir, $lastscan)

$lenghtSaved = UBound ($lastscan)
$lenghtNow = UBound ($listcurrentfiles)

ConsoleWrite("Saved : " & $lenghtSaved & " | " & "Current : " & $lenghtNow & @CRLF)

Select
    case $lenghtNow >= $lenghtSaved
        Normal()
    Case $lenghtSaved > $lenghtNow
        Reverse()
EndSelect
;File compare
EndFunc

func normal()
_FileReadToArray($tempdir, $lastscan)
_ArrayDelete($lastscan, 0)

$listcurrentfiles = _FileListToArray($sharepath)
_ArrayDelete($listcurrentfiles, 0)

$limit = UBound($lastscan) -1 

for $x = 0 to $limit
    $temparraydelete = _ArraySearch($listcurrentfiles, $lastscan[$x])
    Select
        case $temparraydelete = -1
    ;MsgBox(64, "error", "Array Error : " & @error)
        case $temparraydelete >= 0
            _ArrayDelete($listcurrentfiles, $temparraydelete)
    EndSelect
Next
$status = "Normal"
end()
EndFunc

func Reverse()
_FileReadToArray($tempdir, $lastscan)
_ArrayDelete($lastscan, 0)

$listcurrentfiles = _FileListToArray($sharepath)
_ArrayDelete($listcurrentfiles, 0)

$limit = UBound($listcurrentfiles) -1 

for $x = 0 to $limit
    $temparraydelete = _ArraySearch($lastscan, $listcurrentfiles[$x])
    Select
        case $temparraydelete = -1
    ;MsgBox(64, "error", "Array Error : " & @error)
        case $temparraydelete >= 0
            _ArrayDelete($lastscan, $temparraydelete)
    EndSelect
Next
$status = "Reverse"
end()
EndFunc

func end()
    
Select
    case $status = "Normal"
        $teste = UBound($listcurrentfiles)
            if $teste > 0 Then
                $diff = 1
            Else
                $teste = 0
                $text = "No Changes"
            EndIf
            
            For $y = 0 to $teste -1
                $text = $text & $listcurrentfiles[$y] & @CRLF
            Next
    case $status = "Reverse"
            $teste = UBound($lastscan)
                if $teste > 0 Then
                    $diff = 1
                Else
                    $teste = 0
                    $text = "No Changes"
                EndIf
                
            For $y = 0 to $teste -1
                $text = $text & $lastscan[$y] & @CRLF
            Next
            
EndSelect

TrayTip("Changes", "Changes: " & $teste & @CRLF & @crlf & $text, 10)

FileWrite(@TempDir & "\changes.lfu",@MDAY & "/" & @MON & "/"  & @YEAR & " - " & @HOUR & ":" & @MIN & @CRLF & @CRLF)
FileWrite(@TempDir & "\changes.lfu","Changes : " & $teste & @CRLF & @CRLF & $text & @CRLF)
FileWrite(@TempDir & "\changes.lfu","End of log for date above" & @CRLF)

$listcurrentfiles = _FileListToArray($sharepath)
_FileWriteFromArray($tempdir, $listcurrentfiles, 1, 0)

Sleep(10000)
EndFunc

P.S. - It's probable that contains errors in the script... i never finished :):(

Cheers

Edited by november

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

If I'm not mistaken this would have to be on their computer. I only want the program to be on the networked computer that they are accessing. Something like maybe

$i = 0

While 1

$search = FileFindFirstFile("*.*")

Do

$files = FileFindNextFile($search)

$i += 1

$time = FileGetTime($files)

If $time[2] = @MDAY and $time[4] = @MIN Then

$file[$i] = $files

Else

$file[$i] = 0

EndIf

Until @error

$arraysize = UBound($file) - 1

For $r = 1 to $arraysize

If $file[$r] = 0 Then

Else

Some tcp get ip address of creator thing

send message I want to Send

EndIf

Next


Giggity

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Sending file to network computer ? http://www.autoitscript.com/forum/index.ph...ic=46341&hl

try this too http://www.autoitscript.com/forum/index.ph...amp;hl=TCP+file

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks firefox, I'll check them out. Is that angry Mcain?

Edit: I looked at both, but they both require a program being on the individual pc's. Guess I'll have to just email them. As soon as I find out how to get the modified by.

Edited by youknowwho4eva

Giggity

Share this post


Link to post
Share on other sites

Thanks firefox, I'll check them out. Is that angry Mcain?

Edit: I looked at both, but they both require a program being on the individual pc's. Guess I'll have to just email them. As soon as I find out how to get the modified by.

For send anything to other computer, you have to connect to a program wich have same port over TCP or UDP....anyway with this script you can easy send file or message because i did it :mellow:


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

You can probably use net send but the message will b formatted in some way like: PC1 to PC2: A file was added to drive D:

try searching for net send which can be used in windows without having something installed, you just need the messaging service running.Also try it in a cmd to send some text


s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

You can probably use net send but the message will b formatted in some way like: PC1 to PC2: A file was added to drive D:

try searching for net send which can be used in windows without having something installed, you just need the messaging service running.Also try it in a cmd to send some text

Ah, you kill me AoRaToS... I SO wanted to be the first to remember netsend... :( Oh well, I'll be more detailed! ;P

Posted Image

Posted Image

Posted Image

Posted Image

Cheap I know... but it works... :mellow:

The 'messenger' service must be running within XP for this to work. I looked around for a bit, and Vista appears to have removed this Legacy function... lol

$i = 0
While 1
$search = FileFindFirstFile("*.*")
Do
$files = FileFindNextFile($search)
$i += 1
$time = FileGetTime($files)
If $time[2] = @MDAY and $time[4] = @MIN Then
$file[$i] = $files
Else
$file[$i] = 0
EndIf
Until @error
$arraysize = UBound($file) - 1
For $r = 1 to $arraysize
If $file[$r] = 0 Then
Else
ShellExecute("Net Send * File " & $FileName & " has been modified")
EndIf
Next
Edited by BinaryBrother

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