Windows 10: Open file directories with a custom application by default

Since everything I see is “explorer.exe”, I labelled different parts of it in the screenshots at the bottom, to make it easy to understand.

TL;DR

  1. Can I make my own application open directories by default when I click a directory in “1” or “2”?
  2. With the change for the question above, can I still make double-clicking a directory in a manually-opened “3” open in the same “3”, not with my application?

Longer version

There are some incontinences for me in “3”. So I am trying to write a (simple) my own file listing application in C#. Now, what I want is that when I double click a directory on the desktop or clicking things like “Downloads” or “Personal Folder” (in “1” or “2”), my own application gets invoked (with the directory path as an argument), not “3”.

I have searched the web and found a way to “replace the shell” HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell, but that completely replaced everything and the Start Menu/Taskbar were gone. Not that I do not have complaints about the Start Menu/Taskbar, but recreating Start Menu/Taskbar would be daunting, so I only want to replace “3” (or, if possible, “1” also.)

I thought that I could change the “Open” command that I see when I right-click a directory, but replacing the value of HKEY_CLASSES_ROOTFoldershellopencommand(Default) from explorer.exe to another exe did not work. How can I do this?

But after making my application to open directories by default, if I manually open directories in “3” (because I cannot reproduce every feature of “3” and sometimes need to use it), when I double-click a directory in “3”, is it possible to make it open in the same “3”, not with my application?

enter image description here
enter image description here

python 3.x – pylint shows import-error with directories inside the working directory

After installing a new version of Python(from 3.8.1 to 3.8.3) and using it with Visual Studio Code, I’ve encountered an issue with pylint that did not happen prior the upgrade.

My working directory tree is as follows:

📦bot
 ┣ 📂cogs
 ┃ ┗ 📜cog.py
 ┣ 📂utils
 ┃ ┗ 📜__init__.py
 ┃ ┗ 📜format.py
 ┣ 📜__init__.py
 ┣ 📜core.py
📜run.py

run.py is the script’s “entry point” that initializes everything, doing import bot inside it works just fine and pylint has no problems with it. Relative imports have no problems with pylint either as core.py uses from .utils import ....

However, when doing from bot.utils import ... inside cog.py, pylint keeps showing an import-error problem which shouldn’t show up because the code runs just fine.

I am confused why this problem was not present before the upgrade, did I do anything wrong and if so, how can I change this behavior?

i will submit your website in 500 directories for $5

i will submit your website in 500 directories

Hi i am Amid

I am at your service

Welcome to my Services…

If you are looking to promote and increment your business or website then you are at right place.

I will include your business in 500 high-end DA & PA niche directories.

After submission i will send you a screenshot file with detailed report.

  • 500 + Directory Submission in 24 hrs.
  • I am very fast.
  • On-time delivery
  • Increase your search engine visibility
  • Get more traffic or costumers
  • 100% Satisfaction guarantee
  • 100% Real and active link

Thank You.

.

rpm – How do I properly create new directories if they don’t exist, and then copy files into them on the target install device?

I’m trying to accomplish the following steps with the below rpm code:

  1. Copy files into an rpm package from device A (host server or development server) using rpmbuild -ba foo.spec
  2. The rpm package is built and manually transferred/downloaded to the root folder of the target: device B
  3. Install the rpm package on device B using: rpm -i test.rpm
  4. A directory is created /usr/local/etc/NS/enrich/*…etc during the install by the rpm package on device B
  5. The files (source1 through source 4) are then copied into the respective directory on device B.

My code currently does not do this, but I don’t understand why.

Name:       test
Version:    0.1
Release:    0
Summary:    This RPM is for transfering foo lists to a Test device.
License:    TODO
Source0: foo_foov4.csv
Source1: foo_foov6.csv
Source2: foos_approved.csv
Source3: s_all_foos_enriched.csv
Source4: s_foo_foobar.csv

%description
Test Build 0.1

#copy the files
%prep
cp -p %{SOURCE0} .
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .
cp -p %{SOURCE4} .

%install
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foo_Approve/csv/
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foo_/csv/
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foobar_WildApprove/csv/
%{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foobar_Wild/csv/

%{__install} -m 644 -p foo_foov4.csv 
    $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foo_Approve/csv/
%{__install} -m 644 -p foo_foov6.csv 
    $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foo_Approve/csv/
%{__install} -m 644 -p foos_approved.csv 
    $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foobar_fooApprove/csv/
%{__install} -m 644 -p s_all_foos_enriched.csv 
    $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foo_/csv/
%{__install} -m 644 -p s_foo_foobar.csv 
    $RPM_BUILD_ROOT%{_datadir}/%{name}/usr/local/etc/NS/enrich/foobar_foo/csv/
%files
%{_datadir}/%{name}/usr/local/etc/NS/enrich/*

windows – Huge difference in transfer speeds when using separate directories for transfer

I was transferring around 12k images (total size around 2 GBs) from my laptop to my Android phone via USB. Initially, it was around 5-6 images copying per second and soon after around 500 images speed began to drop and reached more than 5 seconds per image. I tried copying them in batches of 500 images but that was no better. It was like the more the number of files in a directory the slower it is to add more to it.

Then what I did is make separate folders in the same directory and copy only about 500 images at a time to each. This way I got speeds of 5-6 images per second similar to what I was getting initially when I was transferring them all at once to a single directory. Later, I simply moved the images out of those folders using native file manager in my phone, which was almost instantaneous.

Why is that speed was decreasing exponentially when I was copying all files to the same directory?

c# – How can I use task async await to get all directories and files with progress report?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Schema;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

        }

        private Task ProcessData(List<string> list, IProgress<ProgressReport> progress)
        {
            int index = 1;
            int totalProcess = list.Count;
            var progressReport = new ProgressReport();

            return Task.Run(() => 
            {
                for(int i = 0; i < totalProcess; i++)
                {
                    progressReport.PercentComplete = index++ * 100 / totalProcess;
                    progress.Report(progressReport);
                    Thread.Sleep(10);
                }

            });
        }



        async Task ProcessRead()
        {
            await Task.Run(() =>
            {
                IEnumerable<string> fileEntries = Directory.EnumerateFiles(@"c:windows","*.*", SearchOption.TopDirectoryOnly);
                int count = 0;
                foreach (string fname in fileEntries)
                {
                    try
                    {
                        count++;
                        string text = File.ReadAllText(fname);
                    }
                    catch (Exception ex)
                    {

                    }
                }
            });
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private async void btnStart_Click(object sender, EventArgs e)
        {
            List<string> list = new List<string>();

            for(int i = 0; i < 1000; i++)
            {
                list.Add(i.ToString());
            }

            lblStatus.Text = "Working...";
            var progress = new Progress<ProgressReport>();
            progress.ProgressChanged += (o, report) =>
            {
                lblStatus.Text = string.Format("Processing...{0}%", report.PercentComplete);
                progressBar.Value = report.PercentComplete;
                progressBar.Update();
            };

            await ProcessData(list, progress);
            lblStatus.Text = "Done !";
        }
    }
}

This will report the progress in percentages.

but I want to use the ProcessRead function to work on a thread so while it’s getting the files and read each file I will be able to click other ui like buttons.

I want to use the ProcessRead function instead the loop i < 1000
I also want to report progress using counting variables how many files and directories was got so far how many files was reading so far.

The idea is to read the files content and doing with each file content something and to do it all in real time and so I ill be able to use ui while it’s working.

Now if I put the ProcessRead function just call it instead the loo I < 1000

private async void btnStart_Click(object sender, EventArgs e)
        {
            List<string> list = new List<string>();

            ProcessRead().Wait();

            lblStatus.Text = "Working...";
            var progress = new Progress<ProgressReport>();
            progress.ProgressChanged += (o, report) =>
            {
                lblStatus.Text = string.Format("Processing...{0}%", report.PercentComplete);
                progressBar.Value = report.PercentComplete;
                progressBar.Update();
            };

            await ProcessData(list, progress);
            lblStatus.Text = "Done !";
        }

The program just freeze I mean the ui freeze and waiting for it to finish.

install – What directories Photoshop and other Adobe stuff, save their stuff or macOS in their behalf?

I am tryin to clean all references that may exist on my disk, to an app I have that is not behaving correctly, so I can reinstall the app.

Photoshop is behaving weird to me. I have tried to reinstall it, but the installation fails. Some files may be stored somewhere else on the mac, with the wrong permissions or corrupted, preventing the installation to run.

So, I have researched all possible directories Photoshop generally changes during install or usage and erased all content I could find related to Adobe inside these directories:

/Applications
/Library/Application Support
/Library/LaunchAgents
/Library/LaunchDaemons
/Library/PrivilegedHelperTools
~/Library/Preferences
~/Library/Application Support/... the respective app folder inside this
~/Library/LaunchAgents
~/Library/Containers/ ... stuff inside this
/var/folders/ ... they put stuff here

What other directories do you know?

I am comfortable with terminal.

c# – How can I use Task Async Await to read files content from multiple directories recursive?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            ProcessRead().Wait();
        }

        static async Task ProcessRead()
        {
            await Task.Run(() =>
            {
                IEnumerable<string> fileEntries = Directory.EnumerateFiles(@"Directory");
                int count = 0;
                foreach (string fname in fileEntries)
                {
                    try
                    {
                        count++;
                        string text = File.ReadAllText(fname);
                        Console.WriteLine(text);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                Console.WriteLine(count);
            });
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

This is working but only for the given directory in EnumerateFiles.
but I want to get all the files in all directories recursive.

For example if I put the directory of windows :

IEnumerable<string> fileEntries = Directory.EnumerateFiles(@"c:windows");

I want it to read the content of all the files in the directory windows and also all the sub directories in windows. So it will read all the files content in the given root directory and all it’s sub directories recursive.

Linux Terminal – Copy All Directories with JS or TS files, setting a max depth of each item being copied

I have hundreds of directories, each with one or more .js or .ts files in them but also other files. Many of them are nested multiple levels deep. What I am trying to do is copy each sub directory to a new directory with the directory contents, but only with the .js or .ts files in them.

Here is what I have so far:

find "." -path "*node_modules*" -prune -o -type f ( -iname *.ts -o -iname *.js ) -printf "%h" | sort -uz | xargs -0 -I _ cp -a _ "/c/test/"

What this is currently doing is copying all directories (excluding the node_modules directories) of file type .ts or .js, and copying them to the /c/test/ directory. However, the problem I am having is that for each directory, it is copying ALL the files AND all the subdirectories when I only want it to copy the .ts or .js files located within that directory. And here is the most important part, for every directory it copies, no matter how deep or shallow that directory is, I only want it to copy that directory. I don’t want to copy a directory with all of the subdirectories located in it. However, I want to copy every sub directory directory no matter how deeply nested it is. Hopefully this makes sense.

Imagine my directory structure is your dresser. Inside each drawer are several other drawers. Some of the drawers have items inside but also other drawers. One could simply empty all the items on the floor, but that’s not what I want to do. I want to empty all the DRAWERS on the floor, keeping the items inside, but no drawer should contain another drawer. But the end result is every single drawer that has items is on the floor.

In other words, the end result should be a /test directory with a bunch of copied directories inside, but each of those directories has NO sub directories inside of them. They should only have js or ts files inside. I hope this makes sense.