3

I'm running an R shiny app locally on my Windows machine that auto-runs every day using a batch file. I recently ran into an issue lately where the R tmp directory /tmp/RtmpXXXXX is removed and the application fails:

Warning in file(open = "w+b", encoding = "UTF-8") :
  cannot open file 
'C:\Users\Carlos\AppData\Local\Temp\Rtmp0maCtT\Rf140c40ab30be': No such file 
or directory  # deleted file
Warning in normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="C:\Users\Carlos\AppData\Local\Temp\Rtmp0maCtT": The system cannot 
find the file specified  # deleted folder
Warning in file(open = "w+") :
  cannot open file 
'C:\Users\Carlos\AppData\Local\Temp\Rtmp0maCtT\Rf140c38044f8': No such file 
or directory
Warning: Error in file: cannot open the connection  # program crashes
Stack trace (innermost first):
    1: runApp
Error : cannot open the connection

I ran procmon and noticed that Disk Cleanup was removing temporary files automatically almost every day, causing the app to crash. I unchecked the settings in the dialog box, but this doesn't seem to have changed anything. Is there any other way to disable cleanmgr.exe from running automatically?

0

1 Answer 1

2

If by Disk Cleanup you mean the automatic job that is triggered when disk space is low, than your first priority should be to find out why it is low and free up some disk space. Windows running out of space is a dangerous condition that could even damage Windows itself.

To disable this automatically scheduled task :

  • Open Task Scheduler
  • Drill down to Task Scheduler Library > Microsoft > Windows
  • Click on DiskCleanup
  • In the right-hand pane click Disable

Another related setting is the Low Disk Space warning that can be disabled as follows:

  • Start regedit
  • Navigate to the key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
  • If Explorer is missing, right-click Policies and choose New > Key, name it Explorer and ensure it is selected
  • Right-click in the right pane and choose New > DWORD (32-bit) Value
  • Name the new entry NoLowDiskSpaceChecks and give it the value of 1
  • Click OK and close regedit

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .