NT4, Adding Extra Folders in Folders - PLZ ADVISE

  bullys 09:21 15 Jan 2004

I have a small problem. What it is that we have Client folders set up on our server. In Alphabetical and numeric order. I.e. A, B, C, D etc. With in those letters are clients i.e. BOBBUILDER, PCADVISOR, SWEETSHOP, etc. Then in there we have 6 folders relating to the relevant department i.e. TAX, ACCOUNTING SERVICES, CORPORATE FINANCE etc. Lastly in there we have Folders by year i.e. 2002, 2003 so on. ----

--- Here’s the problem I need to create up to 6 years in the last folders mentioned i.e. 2004, 2005, 2006 so on. --

I don’t want to have to got in to the folders 6 times and cut and paste the extra folders.

Already we have about 200 clients with just 2003 folders in, so as you can see id be here for quite a while.

I hope I have made this easy and hope I can get a solution on this soon.



  temp003 08:13 19 Jan 2004

Hope this is not too late. See if the following command works.

Suppose your client folders A, B, C, ..., 0, 1, ...9 all reside in a parent folder called "c:\Client Folder" (which of course can be a drive on the network or server). Open a command prompt window and type and enter:

for /r c:\"client folder" %1 in (tax, "accounting services", "corporate finance", "any other subfolder") do if exist %1 md %1\2004 %1\2005 %1\2006

The command - for /r c:\"client folder" - asks the computer to go through the entire directory tree headed by c:\client folder.

%1 is the variable, to be matched against the items in the set (the brackets) separated by commas and spaces (tax, "accounting services", ...).

Then do: if these folders exist, then md (make directory).

So the entire command is to go through the C:\client folder to look for the folders tax, accounting services and so on. If these folders exist, then make the directories 2004, 2005, 2006 immediately underneath the relevant %1 folder.

Folder names with spaces in between should be enclosed with quotation marks.

You can test it out on a test folder with its own subfolders first. I've tested it on my Windows 2000 machine and it works. I think these commands are the same in NT4. Double check the NT4 command reference.

You can do this in a command prompt. Or you can create a batch file (not really necessary since it's only one single command). In a batch file I think the variable should be %%1 instead of %1.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

Inside the iMac Pro - Apple's most powerful Mac yet

iMac Pro release date, UK price & specs

Football : comment regarder la Ligue 1 en direct ?