Dir.glob("c:/Windows/Temp/chef*").each do |target|
directory target do
recursive true
action :delete
end
end
The code above does a listing of existing directories matching the full path (ruby works properly with forward slashes, you can avoid the double backslash on windows and use forward slashes) and loop over them, for each iteration the directory matched will be stored in the variable target.
Each iteration will define a directory resource to this target directory to delete it.
The only drawback is that the listing is done at compile time to define the resources, any temporary directory created during another resoruce convergence time will be skipped and cleaned only in the next run of chef.
Now, the real problem is: what is creating those directories ? That sounds like code in one of your cookbook is not properly cleaning up after itself.