?
Solved

Creating %Temp% with a batch file

Posted on 2006-07-24
2
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 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