
This, of course, is not an article, but a small travel note, but nonetheless. It so happened that 99% of the archives get on my computer to be immediately unpacked in order to get to their contents. And if in a safari make it itself does for me, then in windows you have to click an item in the context menu every time.
At some point I was
sick of it and I wrote a simple service that unpacks everything on my own. It seemed to me convenient and I decided to share with the people.
What it looks like
There is a service in the system.

')
The service monitors the specified folders and monitors the creation of files with specified extensions (by default,
rar and
zip , set by the
Extentions parameter). As soon as the file has appeared, winrar is launched (you can configure another archiver), which unpacks them.
How it works
Everything is configured via the
monitors.cfg config in the ini file format
[WinRar]
c:\Program Files\WinRAR\WinRAR.exe
[Folders]
c:\downloads
c:\distrib
Config can be edited on the fly, the service itself loads changes from it, no need to reload anything.
The file system is monitored via
FileSystemWatcher
- foreach ( var watcher in monitoringFolders.Where ( Directory .Exists) .Select (folder => new FileSystemWatcher (folder) {IncludeSubdirectories = true }))
- {
- watcher.Created + = WatcherHandler;
- _watchers.Add (watcher);
- }
* This source code was highlighted with Source Code Highlighter .
Winrar is launched with the keys
x -ad -o + - unpacking into a folder with the same name with the replacement of files.
How to install
- Download and unzip from here.
- Run install.bat from the AE.Service folder as administrator. He will create a service through sc create (by the way, can anyone answer me why I can create / delete services only through the command line?). And if you just want to test without installation, then there is a simple console application in the AE.Console folder.
Links
- Sources
- Binary
Thanks for attention.