This is an easy question for most of you tech geniuses, but it is just driving me crazy.
User asked me to create a password protected folder on a share drive. The option of getting and installing a 3rd party software for this task was nixed by higher powers. I researched the web and found an easy Dos script saved as .bat file and commonly suggested as a work around. Of course, this bat file basically hides the folder and any reasonably informed user could find it anyway. But what I noticed is that script is "ignoring" command line to turn the folder into hidden system folder (+h +s).
Here is the script:
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
echo Are you sure you want to lock the folder(Y/N)
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
ren Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
echo Enter password to unlock folder
if NOT %pass%== malimedo goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
echo Invalid password
echo Private created successfully
So, what happens is that when you answer "y" to whether you want to lock the folder, the Private folder is renamed to HTG Locker and HTG Locker shows up, even though it is supposed to be hidden. This renders already clumsy "solution" totally useless as HTG Locker is visible and is basically your hidden folder with all the "secret stuff". I made sure that "folder options" options are all checked properly. I read comments from users on the web and some of them had the same problem but there were no suggestion as to why is this happening.
So I am puzzled by the attrib command line which seems to be ignored. I am far from DOS expert, but I am familiar with programming...
Thank you for any advice you may offer.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!