0

The problem is that the system temp directory is required when machine installs updates first thing after a restart. My RAM disk, however, starts through HKLM\Software\Microsoft\Windows\CurrentVerison\Run, which is probably read later in the process.

My question is this - is there a way to redirect the system temp directory to a RAM disk in a way that this redirection is realized before windows installs the updates after restart?

Use case: I have installed a RAM disk that gets initialized on startup. Everything works fine, including rebooting the server (it is possible to save the RAM disk image, making it survive the reboot). However, when I reboot the server as a result of Windows Update the update is undone, because Windows is unable to access the TEMP directory - the RAM disk has not been loaded yet.

Truth to be told the problem is only with the system TEMP directory and there is not much harm not to redirect the system TEMP and leave it as is.

Still, if I could load the RAM disk before the Windows Update resumes then I could place the system TEMP on the RAM disk as well. My question - is it possible?

mark
  • 725
  • 3
  • 15
  • 32
  • Consider simply mounting your ram disk into the system's predefined temp directory instead. This way, you should be able to work around any nastiness with temporarily unavailable TEMP locations. – the-wabbit Nov 24 '14 at 22:42
  • The target directory must be empty, if I am not mistaken. How do you make sure the temp directory is empty when the machine boots? – mark Nov 25 '14 at 02:16
  • You are not mistaken. If deleting the contents does not work for you, you might try mounting the ram disk into a different directory every time (e.g. c:\windows\temp\ramdisk-20141125125612) and set the TEMP/TMP variables in the computer context using `setx` accordingly. – the-wabbit Nov 25 '14 at 11:56
  • So, how does it answer my question? A system update is resumed before any of my scripts are running, hence it is resumed before I have a chance to place TEMP on a RAM disk. – mark Nov 25 '14 at 12:52
  • You will be able to place TEMP on your ram disk afterwards. I assumed your problem is that updates would not complete at all if the %TEMP% storage location is unavailable, thus you were looking for a workaround to this. If the challenge is to have the post-reboot update tasks running using %TEMP% *on the ram disk*, good luck with that - I believe the update installation actions are executed even before service startups, so you would need to have a *driver* loading at system start and doing all the required actions (like formatting and drive letter / mount point assignment). – the-wabbit Nov 25 '14 at 14:12
  • Please, arrange the last reply as an answer, in the absence of other answers I will credit you, even if I do not like it. – mark Nov 25 '14 at 20:49
  • Mark, your question has been put on hold. As such, it cannot be answered until it has been revised / reworded and re-opened. You can help this process by providing a use case around your requirement which is relevant to a sysadmin's work (like "I have an industrial PC with Windows whose flash drive is taking some strain from data written to %TEMP% ..."). – the-wabbit Nov 25 '14 at 22:48
  • I guess sheer curiosity is not a good reason to ask a question on ServerFault. – mark Nov 26 '14 at 00:28
  • I'm afraid not. Sheer curiosity is off-topic here, unfortunately. See the [help/on-topic] to learn what our topics are. – Michael Hampton Nov 26 '14 at 00:30
  • @MichaelHampton That said, I'd like to know if it's possible to put the system temp directory (and some other directories, for which doing so is not a problem) on a RAMdisk, as that's something I definitely could and would use at $dayjob. – HopelessN00b Nov 26 '14 at 01:10
  • @the-wabbit I've reopened this, as it had 3 votes already and would be relevant to me in a professional capacity. Feel free to post your comment as an answer... which I also believe is (unfortunately) accurate. – HopelessN00b Dec 03 '14 at 12:46

0 Answers0