Solved

Creating %Temp% with a batch file

Posted on 2006-07-24
2
352 Views
Last Modified: 2011-09-20
I use a program on one of my servers which nightly deletes the %temp% directory.  I need this recreated at system logon and I can do this in GPO scripts.  What would the batch file be?  Can we make it so if it sees the TEMP folder missing, it creates a new one?  The problem is, another program we run requires the TEMP folder to run properly.  For some reason, it doesn't automatically create it if its missing.  Please supply syntax.  Thank you
0
Comment
Question by:chitchcock
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 17168738
If the environment variable %TEMP% still exist, you could just use

@echo off
mkdir %TEMP%

In case that directory exists, all you get is an error message stating that it already exists, so you can ignore that message.
0
 

Author Comment

by:chitchcock
ID: 17168788
Thanks
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now