Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable path (folder names) in batch file

Status
Not open for further replies.
May 28, 2003
106
0
0
GB
Dear All,

I am new to batch file creation and would need some help. I have to copy a link (url) to the favorites folder in the profile of all users we have. I wouldnt like to do it manual and i also like to get a bit into batching. This is what i wrote so far:
@echo off
:: variables
set drive=u:
set testdrive=c:\test
set copy=xcopy
set link=c:\link\*.*

echo ### coping link into favorites
FOR %%a IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO %copy% %link% "%testdrive%\%%a\% %\favorites"
cd c:

I need to copy the link from a scource (here c:) to the server (u:). The profiles are sorted in folders labeled with the first letter of the userID.
A
B
C
...
Z
in each folder is then the userids. I.e. u:\A\armstrong, u:\A\amboss etc.

I managed to get past the first Folder with the FOR DO, but now i have no idea how to fit in the user folders.

Many thx in advance and kind regards
Asok
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top