Net-Eng99
asked on
Create the same folder in everyone's home folder
Hi,
I would like a script that will create the same folder in every user's home area. So I would like to create "Folder1" in \\server1\user1\Documents\ \\server1\user2\Documents \\server1\user9999\Documen ts ...
But only create this folder if it doesn't already exist.
Is this possible?
Regrads
I would like a script that will create the same folder in every user's home area. So I would like to create "Folder1" in \\server1\user1\Documents\
But only create this folder if it doesn't already exist.
Is this possible?
Regrads
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bah - didn't know oBdA was awake...forgot to refresh, sorry. :^)
Could be done right at a command line with a simple command like:
for /D %F in ("\\servername\basedir\*.*") do (md "%~F\Documents\Folder1" >NUL 2>NUL)
or in a BAT file as:for /D %%F in ("\\servername\basedir\*.*") do (md "%%~F\Documents\Folder1" >NUL 2>NUL)
~bp
ASKER
@oBdA thanks for your solution, I tried that one and it worked perfectly!
Regards
Regards
ASKER
Spot on solution - excellent!
If you can't get to the console, map a network drive to the c$ of the remote server:
net use L: \\server1\c$
then adjust the 2nd line of the code to read
cd /d L:\users
Open in new window