Corruption. Folders turned into files

Page 1 of 2 12 LastLast

  1. Posts : 124
    Windows 10
       #1

    Corruption. Folders turned into files


    Hi

    I seem to have corrupted some of my folders/directories. Can I get them back?

    Win 10Home 64bit 19044.1466

    They were previously folders but now show as files with the same names as the old folders, but without extensions. Double clicking them prompts for a program with which to open them. If I create a new folder and rename it with the same name as their old ones, it says 'There is already a file with the same name as the folder name you've specified. Specify a different name'. [As opposed to the usual 'do you want to merge folders...' thing that you normally get when changing a folder name to an existing name].

    I'm sure that I caused the problem, it only exists in a few folders which are targets in a run cmd.exe command I have been using in an Autohotkey script.


    In the AHK script, I want to manually categorise a directory of photos and move each photo into one-of-a-set of new target folders, based on the hotkey I tapped while hovering over the thumbnail.

    Something like
    1) get Path statement of Sourcefile
    2) wait for inputkey
    3) if Inputkey=k
    4) Move it to Targetfolder_k

    ..where the bit that does the moving (4) is
    run cmd.exe /c %myMoveStatement% , , min

    [%myMoveStatement% is just (Move "SourcePath" "TargetPath_k")]

    That all works fine, normally. But it balks if I don't wait long enough before running it a second time (?until the previous Move command has completed?). I assume that this is when the corruption occurs.

    Is there a way I can change my mysterious new files back into folders? I have run chkdsk /r to no effect.

    thanks
      My Computer


  2. Posts : 42,945
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, forgive the obvious questions:

    Are extensions visible? (By default they aren't).
    Do you have a backup?
      My Computers


  3. Posts : 124
    Windows 10
    Thread Starter
       #3

    Hi
    Yes, View>Extensions is switched on
    I have a backup of the original flat-directory/uncategorised photos. But I have already put a lot of manhours in to moving them into categorised folders, which isn't backed-up. I would prefer to recover the existing stuff rather than start categorising them all again from scratch!
      My Computer


  4. Posts : 456
    Windows 10
       #4

    Can you show a screenshot of the folders that show as files...?
      My Computer


  5. Posts : 124
    Windows 10
    Thread Starter
       #5

    ricardobohner said:
    Can you show a screenshot of the folders that show as files...?
    details view and properties.
    Corrupted-files — ImgBB

    Actually, they look a bit on the small side, I can't be sure whether or not the filesizes are what I would expect as I was progressively moving files into them and the early movers were the smallest.
      My Computer


  6. Posts : 16,927
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #6

    This is the OP's diagram
    Corruption. Folders turned into files-corrupted-files.jpg
    and here's an enlarged portion
    Corruption. Folders turned into files-corrupted-files-enlarged-portion.jpg

    Bob - This should help you get a better response. For your future posts, see How to Upload and Post Screenshots and Files - TenForumsTutorials

    All the best,
    Denis
      My Computer


  7. Posts : 16,927
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    Bob,

    I think your first action should be to try to restore the file association for folders. This is explained in
    Restore Default File Type Associations - TenForumsTutorial

    Best of luck,
    Denis
      My Computer


  8. Posts : 124
    Windows 10
    Thread Starter
       #8

    Hi, thanks for the answers.

    I have now found the four missing folders, apparently intact, lurking in an entirely unrelated part of my computer! I have no idea how they got there; whether or not all their content is intact; or what those strange files are that were left in the original folder.

    Suffice to say that the my original assumption that the folders had been turned into the files was wrong and no longer needs fixing.

    Generally, there is enough wrong with this picture to conclude that it is probably better just to start over from scratch! I will close this topic.

    A bit off topic, but does anyone happen to know if there is a way to send a notification from (a minimized instance of) cmd.exe to Autohotkeys when the cmd command (Move)has completed? (Then I can get AHK to beep at me to say it's OK to run it again; and not cause further corruption). There is a WinWait command in AHK, but it doesn't quite do the right thing. I could just put in a 3 second delay, but it slows things down a lot.

    Thanks & sorry for the misdirection!
      My Computer


  9. Posts : 16,927
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    You could use & to run another command after your main one.
    - I do not know the command to trigger AutoHK from the command line but I understand from others that there is one
    - So, to use a simple example, if you main cmd is Dir and if AutoHK.exe -Fred triggers the AutoHK macro called Fred then
    Code:
    Dir D:\FFFF & AutoHK.exe -Fred
    Denis
      My Computer


  10. Posts : 124
    Windows 10
    Thread Starter
       #10

    Sorry I didn't explain it well

    The Autohotkey script is already running in the background

    I mouseover a picture

    If I decide that the picture is in category k, I tap 'k' and it launches 'subroutine k' in the AHK script, which opens cmd.exe and sends a Move command to move the picture to folder k.

    After that, I mouseover the next picture and If I decide that the picture is in category b, I tap 'b' and it launches 'subroutine b' in the AHK script, which opens cmd.exe and sends a Move command to move the picture to folder b.

    That already works fine. What I'm after is a way to be informed when the first (CLI) Move command has completed, so I don't tap 'b' to start the second one too soon.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:43.
Find Us




Windows 10 Forums