echo on
set userName=test
echo %userName%
set pathParent=%~dp0
set filePath=%pathParent%testFile
echo %filePath%
if exist "%filePath%" (
echo yes
) else (
mkdir "%filePath%"
echo no
)
set isExist=0
net user %userName% >nul 2>nul && set isExist=1 || set isExist=0
if %isExist% equ 1 (
echo 存在
) else (
echo 不存在
net user %userName% /add
)
net user %userName% >nul 2>nul && set isExist=1 || set isExist=0
echo %isExist%
net localgroup Users %userName% /add
@REM icacls %filePath% /deny %userName%:(DC,D)
pause