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
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)
Please log in to answer
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.
so that the conversation will remain readable.