Solved

Creating %Temp% with a batch file

Posted on 2006-07-24
2
350 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

9 Experts available now in Live!

Get 1:1 Help Now