Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

19 Jan 2023, 04:20

One of the most annoying things in Windows 10 has been the following (it wasn't in Windows 7 and I haven't tested Windows 11):

For example when creating a new folder, it's then called "New folder". If you rename the folder and press enter, the folder is still called "New folder". After a random delay, which may be even 30 seconds, it eventually resolves. (There might even be a moment when two folders are listed "New folder" and the renamed one.) The same is after deleting files/folders, they just don't disappear until after huge delays. Also creating a new folder may seem to do nothing, but actually it's just a refresh problem. The problem doesn't occur every time. I'm not sure what worsens the problem.

Has anyone found a solution to this? There's a manual workaround: simply pressing F5 or ctrl+r after the file operation.

I do know one solution: another file manager such as XYplorer. But I still want to find a solution for Windows's own File Explorer.

I did also write a simple AHK workaround, but this may have side effects and problems (I just wrote this, so I have to test for a few days) (at least scrolling to the beginning is an unwanted side effect with this code):

Code: Select all

#If  WinActive("ahk_exe explorer.exe")
  ~Enter:: ; after Enter, refresh
    Sleep 20 ; allow some time for the Explorer window to redraw and get active focus
    Send ^r ; or {F5} to refresh Explorer
    Return
  ~+^n:: ; after New folder operation, refresh
    Send ^r
    Return
  ~^v:: ; after Paste operation, refresh
    Send ^r
    Return
#If
Last edited by jimhoyle on 19 Jan 2023, 04:24, edited 1 time in total.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

19 Jan 2023, 04:23

The solution is likely to eliminate the script, keyboard macro, hotkey manager, or virus that seems to be running separately and interfering with what you are doing! That is my best guess. A broken keyboard might also have this effect, so you could test a separate computer without any script, to see if you are seeing the same thing. This test would require approximately five minutes. I think you will find that the behavior that you described is not actually a feature of Windows 10.

If you are running a program that is consuming the CPU or slowing everything, it could also lead to this effect. Running the Windows Task Manager can illuminate this issue.
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

19 Jan 2023, 05:21

It's interesting that very few people have experienced this problem. But I can assure that it is a problem in Microsoft Windows Explorer, and has been for many years. I do believe that this is a rare problem. But as I wrote, the problem doesn't exist in XYplorer, for example. And it's not another script interfering, I don't have any keyboard managers apart from AutoHotkey and the problem occurs with AutoHotkey not loaded. Not a virus.

My suspicion is the problem has something to do with the fact that my explorer is sometimes laggy in other things as well. For example opening This PC is sometimes extremely slow, the green bar at the top moves very slowly. This may be a "problem" with network drives or something like that. Not an actual problem as everything works, no fault on my network.

But I have noticed the same file operation lag on several PCs, so it's not even confined to one system only.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

19 Jan 2023, 06:41

When creating a new folder, it's then called "New folder". If you rename the folder and press enter, the folder is still called "New folder".
I think that this problem is unlikely related to Windows itself. You probably have something else that is consuming excessive CPU time, or is interfering with normal keyboard operation. It could be a network or other software.
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

19 Jan 2023, 07:31

Something like that is theoretically possible. But I am not able to find the problem. I can confirm that it is not a high CPU usage problem by looking at Task manager. Also it is not because keyboard management would be doing something funny. It happens with mouse operation only.

I am not sure, but I think I have encountered this problem immediately after a fresh Windows installation.
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

20 Jan 2023, 04:37

Hey, thank you for your feedback, I just realized there is one thing that could be interfering. I had FastPictureViewer Codec Pack installed, which should only affect image files (not new folders etc.), but it may be the culprit since it is something related to Explorer. I have to test for several days to make sure.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

20 Jan 2023, 06:43

Testing on a different computer takes seconds instead of days!
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

20 Jan 2023, 07:04

I would like to ask one thing, have you ever encountered a situation where you create a New folder, rename that and then press enter in order to go into that new folder you just created. But then it complains the folder doesn't exist, because it's trying to go to New folder while the name is not that anymore. This happens because after enter it shows New folder for a period of time before updating to the actual new name.

This particular event happened to me now, after already uninstalling the possible culprit Explorer extension.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

20 Jan 2023, 07:08

No, but I do not use Windows File Explorer much. I imagine that it could happen with a "slow system", because a refreshing action does need to happen.

I would keep uninstalling more stuff!

I find that File Explorer's context menu is notoriously slow, as many seconds can pass before it appears. If you have added a lot of your own things to the context menu, you could delete them, though I don't know whether it will help.
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

24 Jan 2023, 03:42

It takes time because there can be days when the problem doesn't occur, especially if I use the computer only for a few minutes. But I do have several PCs and I can confirm, that on one computer I do not have any context menu additions, thumbnail viewers or anything of that nature installed (and AutoHotkey not running). But still the problem is exactly as I described. For example I can't create new folders and see them. I could create 10 new folders, wait for 30 seconds and nothing would appear in Explorer. Ctrl+r (or F5) refresh always works, then it's refreshed (new folders appear).

I am surprised no one else seems to suffer from this problem (I have noticed this for maybe 7 years already).
RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

24 Jan 2023, 09:59

Micro$oft's OneDrive has been notorious for slowing down file operations, especially if you sync files to it. If you don't use OneDrive, try uninstalling it and see if it cures your problem. If you do use it, well, you may have to live with the consequences.

Russ
User avatar
rommmcek
Posts: 1480
Joined: 15 Aug 2014, 15:18

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

25 Jan 2023, 02:20

@jimhoyle : Oh yes, definitely it occurs once and a while and even after deleting a file it remains displayed for a period of time, sometimes.
I think explorer in modern Windows OS-es caches the data and refreshes on it's own logic, that's why manuel refresh always works.
To fix it with AutoHotkey you can try WatchFolder(). It should detect the change immediately and then you can send F5 to explorer(s).
jimhoyle
Posts: 40
Joined: 19 Dec 2015, 15:49

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

23 Feb 2023, 02:52

I believe this is not restricted to OneDrive, the behavior seems to exist on all folders, including local and network drives (I'm not 100% sure, but I think so). It concerns all file operations, including copy+paste and dragging/moving. So I could copy a file to a local folder, and the copy finishes, but nothing appears in the target folder. Only if I refresh the folder does it appear (or maybe if waiting for a very long time, for example a minute).

Thanks for the WatchFolder() tip. I'll try it and test it with time.
RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: Windows 10 / after renaming the folder, the old name persists, how to fix this with AutoHotkey?

23 Feb 2023, 06:55

So, here's a shot in the dark:

If your storage drive is an SSD, this doesn't apply, BUT, if it is a conventional spinning rust drive, and especially if it is a laptop, it is very possible that your hard drive is spinning down after a certain amount of time to conserve power. It would then take a few seconds to come up to speed whenever you needed to access it. This could account for a lot of sluggishness in your system.

To check (in Windows 10), go to Settings->System->Power & Sleep->Additional power settings->Change plan settings->Change advanced power settings

You should get a dialog box like:
image.png
image.png (24.51 KiB) Viewed 798 times
Again, SSDs won't be affected, but a hard drive will, especially in a laptop with conservative power settings while on battery. We have a backup server with a couple of 14TB hard drives that is typically only needed during the nightly backups, so the drives spin down after a few minutes of inactivity - which is perfectly fine. However, if we need to access something on those during the day, it can take 10 to 15 seconds for them to "wake up".

If you do have a hard drive, I would strongly recommend replacing it with an SSD anyway - you will notice an immediate speed improvement.

I create new folders all the time, although I typically give them a name at the time of creation rather than letting them default to "New Folder". Nevertheless, any file or folder renaming operation I do takes place immediately and is immediately auto-refreshed (except in the aforementioned case on our backup server), so I don't think your issue is with Windows in general.

Hope this helps,

Russ

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], DecimalTurn, Google [Bot], macromint, peter_ahk and 359 guests