0

Hi,
I've seen below code on a website for how to protect a folder with a password using notepad (notepad tricks)
I am seeking for advice if below code is correct. I mean by correct that nothing is wrong with the code/ some added characters which may cause harm to the computer / privacy.

May I ask which language is this?

cls
@ECHO OFF
title Folder Private
if EXIST "HTG Locker" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private "HTG Locker"
attrib +h +s "HTG Locker"
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== PASSWORD_GOES_HERE goto FAIL
attrib -h -s "HTG Locker"
ren "HTG Locker" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

Thank you.

Comments
  • 3
    that is a batch (.bat) script. its window's shitty little DOS-era scripting language that makes us all think that bash has a decent syntax.

    for anything but a really quick script, I suggest trying a real scripting language. Node.JS, python, whatever, don't waste too much time with DOS

    Checkout computerhope.org, I remember them having the best docs.
  • 0
  • 0
    Lol I just assumed the wk13 tag was put in here. I just noticed it isn't...
Add Comment