-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLGComm.bat
More file actions
58 lines (58 loc) · 1.34 KB
/
Copy pathLGComm.bat
File metadata and controls
58 lines (58 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
net use X: /delete
cls
set my_name=Hk.C
if not exist D:\dialog\1.txt (
md D:\dialog
echo [Dialog]> D:\dialog\1.txt
)
net share log
cls
if not %errorlevel% == 0 (
net share log=D:\dialog
cls
)
echo Welcome to LGComm (Local_Group Communicatior)!
echo Copyright@Yauhak Chen (CYH)
echo 2022/2/3,forever.
:ip
set /p lg_ip=Input IP Address:
ping %lg_ip%
cls
if not %errorlevel% == 0 (
if not %errorlevel% == 1 (
echo Error code:%errorlevel%
echo Oops!Here has been some errors with your network! :-(
set /p exit =Please press [Enter] to continue...
exit
) else (
echo Maybe you gave a wrong IP address?
goto ip
)
)
net use X: \\%lg_ip%\log
cls
if not %errorlevel% == 0 (
echo Error code:%errorlevel%
echo Fail to connect! :-(
set /p exit =Please press [Enter] to continue...
exit
)
:start
type D:\dialog\1.txt
set /p "for_send=::::"
if "%for_send%" == "exit" (
net use X: /delete
exit
)
if NOT "%for_send%" == "" (
copy X:\1.txt D:\dialog\1.txt
echo ::[%my_name%]%date% %time%:: %for_send% >D:\dialog\2.txt
set "for_send="
copy D:\dialog\1.txt /a + D:\dialog\2.txt /b = D:\dialog\1.txt
del /f /s /q D:\dialog\2.txt
) else (
copy X:\1.txt D:\dialog\1.txt
)
cls
goto start