Tmp on Windows as / tmp on Linux

I created a folder on Windows, C: \ tmp \, and I want it to behave like / tmp / folder on Linux, i.e. its contents are deleted each time the system boots.

I think the commands to run can be (at least on windows 7):

RD C:\tmp /S /Q
MKDIR C:\tmp

A way to execute these commands on every boot? Or, the best way to do this?

+5
source share
2 answers

I do this through a shutdown script to clear a directory named c:\null

Run gpedit.mscand see http://technet.microsoft.com/en-us/library/cc770300.aspx for instructions on setting up a script to run.

The bat file that I am running is

@echo off
@rd c:\null\ /s /q
@md c:\null
+4
source

%TEMP%, Windows, Windows.

Windows , ( , ).

%TEMP%, del %TEMP%\* /s /f /q, , .

script , @Alex K.

+2