ejes consulting

Techincal Consulting Design and Automation

hidefolder.bat

with one comment

@echo off
if ‘%1’ == ‘lock’ goto lockfolder
if ‘%1’ == ‘unlock’ goto unlockfolder
goto show_usage
:show_usage
echo %0 [lock/unlock] {folder}
echo example:
echo    “C:\\> %0 lock private”
echo    “C:\\> %0 unlock private”
goto exit
:nonexistant
echo %2 does not exist!
goto exit
:notlocked
echo %2 is not locked!
goto exit
:lockfolder
if not exist %2 goto nonexistant
echo Locking %2
ren %2 %2.{645FF040-5081-101B-9F08-00AA002F954E}
echo Folder %2 is now locked!
goto exit
:unlockfolder
if not exist %2.{645FF040-5081-101B-9F08-00AA002F954E} goto notlocked
echo Unlocking %2
ren %2.{645FF040-5081-101B-9F08-00AA002F954E} %2
echo Folder %2 is unlocked!
goto exit
:exit

Advertisements

Written by ejes

July 27, 2009 at 7:34 am

One Response

Subscribe to comments with RSS.

  1. […] Like normal, I created a batch script for those of you interested.(https://ejesconsulting.wordpress.com/scripts/hidefolder-bat/) […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: