# MSDOS: Batch file: Copy a specific folder to another temporary folder



## Neha (Aug 24, 2004)

Hi,

I am writing a batch file that copies a folder say newfolder to a temporary folder. 

This temporary folder has the name as TempFolder_xxxxxx followed by a random number.

What I need to do is
1. Do a "dir" and get the current name of the folder "TempFolder_xxxxxx"
2. and once I have it, copy the folder from d:\MyCode\newfolder to d:\scripts\TempFolder_xxxxxx\newfolder

Is there a way to do this? I am not very familiar with batch files

Thanks 
Neha


----------



## Xtant (Aug 19, 2004)

Sure you can do it but how are you planning on creating the random number?


----------



## Neha (Aug 24, 2004)

the temporary folder is already created.

eg. TempFolder_5464646

The number part changes every time I restart the server. So I do not have the "random" number with me. I probably will have to do a "dir". get the current full name of the temp dir and then, do a copy.


----------

