Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

USB Device Info Logger

A lightweight Python script that logs key system information each time it's run. Ideal for portable USB usage or logging purposes.

βœ… Features

  • Logs the following:
    • Current user path (C:\Users\Username)
    • Device manufacturer and model
    • Operating System name and version
    • Timestamp (24-hour format with seconds)
  • Appends each entry to the log file without overwriting
  • Includes error handling β€” logs any exceptions
  • Works as a standalone script or as a .exe

πŸ“‹ Example Log Output


C:\Users\JohnDoe Dell Inc. Inspiron 5537 Windows 11 2025-07-22 14:08:56

If something goes wrong:


## ERROR: Couldn't collect data - \[error message]


πŸš€ How to Use

1. Install Python & Required Modules

Make sure Python 3.x is installed. Then install required modules:

pip install wmi

The script uses built-in modules: getpass, platform, and datetime, and one external module: wmi.


2. Run the Script

Run using:

python usb_logger_real.py

A file named device_log.txt will be created (or updated) in the same directory.


3. Optional: Convert to .exe

You can convert this script to an executable (no console window):

pyinstaller --onefile --noconsole usb_logger_real.py

If you want it to run silently from a USB, you can use Samlogic USB Autorun Creator

  • since bat to exe converted files are caught by virus guard this is the best method

4. (Optional) Add autorun.inf for Legacy Windows

Note: Autorun from USB is blocked on most modern Windows versions (since Windows 7). You can use USB AUTO RUN CREATEOR : https://usb-autorun-creator.en.softonic.com/

Example autorun.inf:

[autorun]
label=Kingston 32GB
icon=pen.ico
open=usb_logger.exe

❗ Disclaimer

This project is intended for educational and authorized usage only. Logging data from systems without user consent may be illegal.


πŸ“„ License

Free to use and modify for personal or academic use.

About

A small Python script that logs system information (manufacturer, model, OS, user profile path, and timestamp) to a file every time it runs. Useful for stealth logging via USB autorun (on legacy systems that support it).

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages