Pvt data locked (batch file protection)

ragef3

Thread Starter
Joined
Sep 4, 2021
Messages
4
i had found a way to lock an individual folder using the batch file method from youtube it worked and now when i try to click on it it dosent ask me the password and just pops a prompt that says you may not have thepermissionto view this file, i remember my password, but the prompt dosent even pop up :/

the code:
Batch:
@Echo OFF
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDPrivate
:CONFIRM
echo Are you sure to lock this 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 "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock Your Secure Folder
set/p "pass=>"
if NOT %pass%== YOUR-PASSWORD goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
MDPrivate
md Private
echo Private created successfully
goto End
:End
 
Last edited by a moderator:

lochlomonder

Colin
Trusted Advisor
Spam Fighter
Joined
Jul 24, 2015
Messages
3,754
Welcome to the forum, @ragef3.

First things first: can you copy & paste the code from your batch file into this thread, so we can look over the commands and see what it was doing? That way, we can work on rolling back the unforeseen change to your folder security permissions.
 

ragef3

Thread Starter
Joined
Sep 4, 2021
Messages
4
Batch:
@Echo OFF
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDPrivate
:CONFIRM
echo Are you sure to lock this 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 "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock Your Secure Folder
set/p "pass=>"
if NOT %pass%== YOUR-PASSWORD goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
MDPrivate
md Private
echo Private created successfully
goto End
:End
the link where i got it from https://gist.github.com/pknowledge/1feef32fa21475eb9742ea247aefe1af
 
Last edited by a moderator:

Xsage

Dave
Joined
Jan 8, 2016
Messages
343
First of all, this is not an effective way to secure your data, anyone can still view and access it. If you are serious about securing your data or protecting your privacy I'd strongly recommend not using this and using some form of encryption instead.

I'm not sure why you are getting the message you are getting though, its not related to the script and seems to be to do with windows RBAC. Are you logged in as an administrator?

If so you can go to file explorer of the directory where your folder is stored, click on the "View" tab and click options > change folder and search options > View and untik "Hide protected operating system files (recommended).

1630845807253.png

You should then be able to go into your "protected" folder without the password and copy out all of your files to a new unhidden directory.

Once you have done this delete the "conrol panel" folder and make sure you retick "hide protected operating system files (recommended)"

There are better method such as using the inbuilt windows 10 folder encryption:
https://www.onmsft.com/how-to/how-to-password-protect-a-folder-or-file-in-windows-10
This means that only your account can access that folder.
 

Cookiegal

Karen
Administrator
Malware Specialist Coordinator
Joined
Aug 27, 2003
Messages
121,349
Ragf3,

I've edited your posts to use the proper code tags rather than table tabs. When posting code kindly use the proper code tags. There is a specific option for batch codes. This makes it easier for everyone. See the instructions on how to do that in the sticky post at the top of this forum. There's a link to it below. Thank you.

https://forums.techguy.org/threads/please-read-before-posting.1024965/
 

managed

Allan
Moderator
Joined
May 24, 2003
Messages
15,626
Apart from the criticisms in previous posts I can't see any way of creating a password using that batch file.
 

ragef3

Thread Starter
Joined
Sep 4, 2021
Messages
4
thank you so much dave, yeah man i wasnt completely aware of all of this i just needed a temp solution to lock some files in my hard disk so i just googled it up and did it after i watched the first yt vid, i liked the airquotes xD ; i did exactly what u told me to and i can see my files but i cant really access themor transfer them when i try to do so it asks me if i want to copy without encryption, and even if i say yes to that it stops after 30 seconds and says you need permission from VAIO\"MYUSERNAME" to transfer this file, i know this is another entire problem but i would really appreciate some help bro what do i do? i did the advanced>findnow>add....too and i changed permissions dint work then i tried the advanced sharing option and changed some permissions there still dint work please help _/\_
 
Last edited by a moderator:

Xsage

Dave
Joined
Jan 8, 2016
Messages
343
Interesting, as I mentioned previously the script you provided does not use encryption in any way so it is odd that you are getting that message. There must be something else at play here and as you said is an entirely different problem - and is probably the reason your script stopped working for you. Did you try and use any additional methods aside from running this script to secure your data?

Also,
What operating system are you running?
Are you logged in as an administrator account?
Do the file icons have a padlock symbol on them?
 

ragef3

Thread Starter
Joined
Sep 4, 2021
Messages
4
Interesting, as I mentioned previously the script you provided does not use encryption in any way so it is odd that you are getting that message. There must be something else at play here and as you said is an entirely different problem - and is probably the reason your script stopped working for you. Did you try and use any additional methods aside from running this script to secure your data?

Also,
What operating system are you running?
Are you logged in as an administrator account?
Do the file icons have a padlock symbol on them?
no i havent although before i found this platform i did meddle with the general permissions trying to open the files indirectly in vain, but no, i dint really use other methods.
windows os 64bit
yes
yes they do each and every single file
 

Xsage

Dave
Joined
Jan 8, 2016
Messages
343
Try right clicking a file and unlocking it using "File Ownership" from the context menu:


If you are able to do that, it should unlock the file and allow you to copy it out etc.

If that doesn't work I suspect you have somehow lost your certificate. To check that:
  1. Right click the file and go to properties.
  2. Click Advanced under the General Tab
  3. Click Details next to "Encrypt contents to secure data"
  4. Make a note of the Certificate thumbprint
  5. Click start and search for "certificates"
  6. In the search results you should see "Manage user certificates" - click on it
  7. In the window that appears, expand "Personal"
  8. Go into the "Certificates" folder
  9. Find your certificates with the "Indended Purposes" of "Encrypting File System"
  10. Double click them to open their properties
  11. Go to the details tab
  12. Scroll down and find the "tumbprint" field
  13. Check to see if any of those certificates match the thumbprint noted in step 4


Let us know if you where able to unlock the file or if you have the certificate in your personal store for those files.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top