From 3f7fd9dc728c3137fb3c2b4df9ac4fcb69a886ba Mon Sep 17 00:00:00 2001 From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch> Date: Fri, 20 Jul 2018 15:02:19 +0200 Subject: [PATCH] Check and report size of user profiles on startup NOTE: this is known to fail for permission reasons, the commit is in fact just to save the code and serve as an example (and to be reverted right away). Relates to #20 --- ATxService/AutoTx.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ATxService/AutoTx.cs b/ATxService/AutoTx.cs index 770e354..58ef61b 100644 --- a/ATxService/AutoTx.cs +++ b/ATxService/AutoTx.cs @@ -403,6 +403,19 @@ namespace ATxService } Log.Debug(msg); + + Log.Info("User Profile Directories:"); + var profilesDir = new DirectoryInfo(@"C:\Users"); + foreach (var userProfile in profilesDir.GetDirectories()) { + Log.Info(userProfile.Name); + try { + var userProfileSize = FsUtils.GetDirectorySize(userProfile.FullName); + Log.Info(userProfileSize); + } + catch (Exception e) { + Log.Error($"getting size of [{userProfile.FullName}] failed: {e.Message}"); + } + } } #endregion -- GitLab