Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

need help with .bat command

batch

  • Please log in to reply

#1
cycling james

cycling james

    New Member

  • Member
  • Pip
  • 4 posts

so ive been using the text below to put a password on my folders. i want to make it shutdown my computer if the password  is entered incorrectly, could somebody tell me what to add and where to add it. Thanks in advance,James.

 

 

cls
@echo off
title Folder Locker
IF EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­09D}" GOTO UNLOCK
IF NOT EXIST Locker GOTO MDLOCKER
echo Folder Created.
: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 Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­09D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­09D}"
echo Folder Locked.
GOTO END

:UNLOCK
echo Enter password to unlock the Folder :
set/p "pass="
IF NOT %pass% == YourPassword GOTO FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­09D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B303­­09D}" Locker
echo Folder Unlocked Successfully.
GOTO END
:FAIL
echo Invalid Password!
GOTO END

:MDLOCKER
md Locker
echo Folder created.

GOTO END
:END
PAUSE


  • 0

Advertisements


#2
strollin

strollin

    New Member

  • Member
  • Pip
  • 8 posts
:FAIL
echo Invalid Password!
Shutdown /s /t 0 /f   <=======  Add this line here
GOTO END

:MDLOCKER
md Locker
echo Folder created.

GOTO END
:END
PAUSE

  • 1

#3
cycling james

cycling james

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts

Thanks


  • 0

#4
Steve Works

Steve Works

    New Member

  • Member
  • Pip
  • 2 posts

Great idea. I'll also implement the code on my work computer (the kids tend to have fun on it).

_______________________________

Steve Works

software development Romania


  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP