Solved

Creating %Temp% with a batch file

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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