Skip navigation

JSI Tip 0971. How do I reset the permissions on the Users directory?


If you need to reset the permissions on the Users directory, you can use JSIUPERM.bat, as long as the users folder name is the same as their UserName.

To use JIUPERM.bat:

JSIUPERM <Drive:>\Folder

Example:

JSIUPERM c:\Users

You will need to create a c:\yes.txt at a CMD.EXE prompt by typing:

 C:    
 copy CON YES.TXT   <press the enter key> 
 y   <press the enter key> 
    <Press CTRL+Z> 

JSIUPERM.bat contains:


@echo off
if "%1"

"" goto syntax If not exist %1 goto syntax cacls %1 /G Administrators:F SYSTEM:F < c:\yes.txt setlocal set fold=%1 set fold=%fold:"=% for /F "tokens=*" %%i in ('dir "%1" /b /ad') do call :UPERM "%%i" endlocal goto end :syntax @echo Syntax JSIUPERM Drive:\ParentFolder goto end :UPERM set user=%1 set user=%user:"=% if /i %1

"default" goto dflt cacls "%fold%\%user%" /T /G Administrators:F SYSTEM:F %1:F < c:\yes.txt goto end :dflt cacls "%fold%\%user%" /T /G Administrators:F SYSTEM:F < c:\yes.txt :end

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish