My %temp% folder keeps deleting itself

Discussion in 'Windows 10' started by TheCollDude489, Jul 5, 2019.

  1. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    #1 TheCollDude489, Jul 5, 2019
    Last edited: Jul 7, 2019
    This has been happening for around a month, and I have no idea what is causing this issue. Basically, while the computer is on and running, the Temp folder of the current user (%temp%) will just be deleted, as well as all of the contents within. This causes programs that use the user temp folder (7Zip being a good example) to malfunction since they cannot find the user temp folder.

    I have to recreate the folder manually every time this happens, since the system does not recreate it automatically, even after a reboot.

    I do not have any active antivirus programs installed, and I do not have any 3rd party cleaning tools installed. I am using legitimate Windows 10 Enterprise, with the version being 17763.529.

    Could anyone help me in solving this issue?
     
  2. coleoptere2007

    coleoptere2007 MDL Guru

    Apr 8, 2008
    3,311
    1,938
    120
    is storage sense "on" ?
     
  3. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    There should be something very wrong.
    At first, any file or folder cannot be deleted if it is in use (Temp folder is always inuse if computer is turned on, it is system folder), for the second - it is readonly protected folder.
    Are You sure You speak about system made Temp folder? It is located in folder %LocalAppData% (it's the common folder, visible and protected readonly folder and is available also if to use such a directory names %TEMP%, %Temp%, %TMP% etc), the other is temp folder in location %userprofile%\AppData\Local, if You have more than one user.
    Now I recommend You to check Your system health and repair, restore or fix what needed.
    Then restore all default permissions for all files and folders.
    And if then everything is the same, ie nothing not changed, then must look for the reason more deeply.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    Storage Sense on both PCs are off. I also updated the laptop to the latest update, and the issue still seems to be happening.

    Yes, the system-created Temp folder in the %localappdata% is the one getting removed automatically. Specifically, it happens most often when it's not in use by any running programs, or when the PC is starting up. I have not tampered with any permissions of system files/folders (except for the Temp folder in the Local App Data in which I tried to set it as complete read-only, but it was still deleted in the end by the system). I have run the SFC command, and it has reported no integrity violations, on both PCs.
     
  5. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    Can You tell about how are You clean computer. Ie what cleaners You use.
    And the second - read only works only for users, not for system and most of programs. Ie, You or your "friends" cannot delete, but most of programs and system itself can.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    6,015
    4,148
    210
    Try making a new user account and test there
     
  7. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    Oh, OK. Just tried making it Read-Only to see if that actually changes anything. Found out that it didn't when the folder was deleted like 15 minutes after.
    The only Antivirus I actually have installed is Malwarebytes Free, but it does not run on startup (since it's the free version), nor does it do any "Maintenance" in the background. I usually don't run the tool that often either, usually once a month at most.
    I had Avast installed previously, but I removed it since it was false-flagging many of my applications and programs I was working on, as well as breaking other programs or making them run poorly.
    I do not use any dedicated 3rd-party cleaning tools on my PC, but I do use programs like Revo Uninstaller to remove leftovers of programs after I've uninstalled them. None of those programs run automatically, I have to manually run them before I uninstall an application for them to actually look for leftovers.

    OK, I'll go ahead and do that, and report back on if the %temp% folder for that user is deleted as well.
     
  8. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
  9. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,449
    90
    If gamemaker studio is deleting the entire %temp% folder, that's one poorly written piece of software. I can't wait to hear the rest of the story on this, so I'm going to sit back with a bag of popcorn and watch as the story unfolds...
     
  10. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    I did that, and the problem stopped happening. As soon as I reinstalled GameMaker Studio and tested a project, the issue came right back. What's strange is that this issue only really started happening after the developers dropped support for GMS 1.x. Probably a hidden function in the program that the devs activated? Using taskkill to terminate Runner.exe instead of closing it normally prevents it from deleting %temp% though, which is a good thing I guess.

    Yeah, it strange why it even touches %temp% in the first place, considering it never even saves temporary files there. You are right about it being poorly written though, strange issues pop up for other users commonly that require workarounds to fix.
     
  11. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    6,015
    4,148
    210
    Is there a setting in gamemaker studio to specify a custom temp dir? Maybe a config file in the install dir or something if not in the program itself
     
  12. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    Yes, there is indeed a setting to specify the temporary directory. It is currently set to LocalAppData. I'll try setting it to the Temp directory and see what happens.
    EDIT: It still attempts to delete everything in the whole Temp directory, but can't delete the folder itself anymore luckily.
     
  13. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,396
    1,322
    120
    Such things are called "Dangerous Malware". The Temp folder is what you discovered to be deleted. But let me to ask how many folders and files does it changes or deletes at all?
    Are you aware of this what is already changed or deleted?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    It mainly deletes everything it can inside of the Temp directory. As soon as it sees a file it can't remove, it cancels the delete process. I have also monitored the Runner.exe process, and it doesn't really touch anything else other than the temporary compiled game files created by GameMaker (in which it only reads them).
    I would not be surprised if it deletes the Temp folder as an attempt to free up space, as the temporary files created by GMS do take up a lot of disk space if you don't clean them up or remove them.
     
  15. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    6,015
    4,148
    210
    I was thinking more along the lines of setting it to say a new folder on the Desktop and see if it forgets about %temp% (Just temporarily as a test), as %temp% is also in LocalAppData

    If that works, create a folder somewhere for it to use as temp on a permanent basis that matters not if it deletes it

    Could just be that it thinks %temp% is only used for gamemaker studio and is just cleaning up after itself
     
  16. TheCollDude489

    TheCollDude489 MDL Member

    Apr 16, 2018
    147
    32
    10
    OK, I tried setting the temporary directory to a new folder I created on the desktop. It still attempted to delete %temp% and everything inside.
     
  17. MrMagic

    MrMagic MDL Guru

    Feb 13, 2012
    6,015
    4,148
    210
    #20 MrMagic, Jul 8, 2019
    Last edited: Jul 8, 2019
    Did it use the new folder as temp at all?

    EDIT - And did you restart the program after setting the new dir?

    Probably best to contact the devs of gamermaker studio tbh, they'll be able to tell you what's wrong no doubt