/build/static/layout/Breadcrumb_cap_w.png

Creating folders and assigning rights script help

Hello All!

Help on the following please would be greatly appreciated:

The object is to run a script which checks for users Home drives in defined locations and if they dont exist then create a home drive folder and assign Novell rights to it for that user.

Script so far
I have a text file with Novell Usernames and contexts in the form of "Username,.Username.xxx.xxx.xxx" called data.txt which will be used for the loop.

@ECHO ON
SETLOCAL EnableDelayedExpansion
FOR /F "tokens=1,2 delims=," %%A IN ("C:\data.txt") DO (
SET FOUNDFOLDER=0
ECHO %FOUNDFOLDER%
IF EXIST "\\Location1\%%A" SET FOUNDFOLDER=1
IF EXIST "\\Location2\%%A" SET FOUNDFOLDER=1
IF EXIST "\\Location3\%%A" SET FOUNDFOLDER=1
ECHO %FOUNDFOLDER%
PAUSE
IF [%FOUNDFOLDER%] EQU [0] (
ECHO Creating folder for %%A
MD "U:\NewHDrives\%%A"
REM RIGHTS "U:\NewHDrives\%%A" RWCEMF /NAME= %%B
)
)
EXIT

The bit that is not working is SET FOUNDFOLDER=1 and it does not switch to 0.
Please help or if anyone knows another way that would be great.

Thanks

0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ