Skip to content

Instantly share code, notes, and snippets.

@muthuishere
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save muthuishere/17ffd4d4fed0d5b5756b to your computer and use it in GitHub Desktop.

Select an option

Save muthuishere/17ffd4d4fed0d5b5756b to your computer and use it in GitHub Desktop.
Lock unlock folders
REM ===========unlk==============
@echo off
IF NOT EXIST c:\opt\ew GOTO EXIT
attrib -h "opt\ew"
IF NOT EXIST "c:\opt\New Folder" GOTO PROCEED
attrib -h "opt\New Folder"
rmdir /Q "c:\opt\New Folder"
:PROCEED
ren c:\opt\ew "New Folder"
attrib +h "opt\New Folder"
:EXIT
REM ==============lk ================
@echo off
IF EXIST c:\opt\ew GOTO EXIT
IF NOT EXIST "c:\opt\New Folder" GOTO EXIT
attrib -h "opt\New Folder"
ren "c:\opt\New Folder" ew
attrib +h "opt\ew"
mkdir "opt\New Folder"
:EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment