Computer Help forum

Question

I messed up bad made folder inacessable!

by thebic4 / November 17, 2012 7:58 AM PST

ok i was thinking after i finally fixing my from being infected nasty trojan. i thought what if i password protected my system 32 folder (like that would stop a hacker). I wanted to test it out incase i messed up and brick my pc. I tested it out on my documents folder (don't know why i didn't make a new folder) and copied a script from online in not pad like 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

and saved it as a .bat. when executed it would ask if i wanted to password protect a folder. i pressed yes and it created a private folder i moved the my document folder into the private folder and re-ran the .bat to password protect the private folder. i entered in a simple password called test1. when i applied the password it made the private folder disappeared as expected. but when i went to open it by running the .bat file and entered the password test1 it just closed the the .bat and did not open the folder. now the folder is inacessable and to make matters worst i deleted the .bat thinking it would fix it. i am using XP by the way and i really need to finish typing my report on Edgar Allan poe by monday!

Answer This Ask For Clarification
Discussion is locked
You are posting a reply to: I messed up bad made folder inacessable!
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: I messed up bad made folder inacessable!
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.

All Answers

Collapse -
Answer
Should be an easy fix.
by Edward ODaniel / November 17, 2012 11:51 AM PST

re-create the batch file by copying the following and pasting it into that folder you created.

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%== test1 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

NOTE that I bolded the one change to make use of the test1 password you say you used. You could have just as easily gained access by typing PASSWORD_GOES_HERE since you did not EDIT the batch file as the instructions stated to perform the following after copying their script into notepad:


The next step is to change the PASSWORD_GOES_HERE<i><b> text to whatever
you'd like your password to be. Don't use an easy-to-guess password.

Now we need to save the text document.</b></i>

Collapse -
PS All that batch file really does ...
by Edward ODaniel / November 17, 2012 12:09 PM PST
In reply to: Should be an easy fix.

is the following as you can see by reading the script.

If you do not have a directory (folder) named Private it will create the folder the first time you run the batch file. If the directory Private already exists it prompts you to lock it.

It also checks to see if the folder HTG Locker is present and if so it asks for the password to rename HTG Locker to Private.

Popular Forums
icon
Computer Help 49,613 discussions
icon
Computer Newbies 10,349 discussions
icon
Laptops 19,436 discussions
icon
Security 30,426 discussions
icon
TVs & Home Theaters 20,308 discussions
icon
Windows 10 360 discussions
icon
Phones 15,802 discussions
icon
Windows 7 7,351 discussions
icon
Networking & Wireless 14,641 discussions

Tech Tip

Stuck without Internet and want to watch movies?

CNET shows you how to download movies and TV shows onto your device using Amazon Prime so you'll always be entertained.