1.11M Members

DOS command for password protecting Files and Folders

 
0
 

Please tell me by which DOS command, we can protect a file or folder with a password.

 
0
 

pls use pkzip to compress and protect from password in dos

 
0
 

there is no such command in MSDOS

 
0
 

RE: to protect to Folder go to DOS Prompt then select the directory where the folder is like my folder is in D partition and named local
d:\
D:\attrib local +h +s

you will se your folder is hidden but it will be not show in show hidden files option..

no if you want to see your folder do the same process but put -h -s like

d:\
D:\attrib local -h -s
(REMEMBER IT IS NOT A HIDDEN OPTION)

Remember me in your prayers

Thanks & Regards
Kashif Mohammad (+92-314-9669697)

 
-1
 

@echo off
title password protection
If EXIST (name of your folder) goto start
goto error

:start
echo Enter Password
set/p "pass=>"
if %pass% == (password) goto unlock
if %pass% == lock goto lock

:unlock
ATTRIB -H -S (name of folder)
goto end

:lock
ATTRIB +H -S (name of folder)
goto end

:error
echo Invalid

:end

This line is not to be written in the batch file. This has been written to inform
You that in places where the words have been written in bracket there should
Be replaced by the aims written in the bracket and I would prefer you to put the
File you want to secure and the batch file in one folder which consists of only
Two folders. Thank you.

 
1
 

please don't revive old threads, and certainly not by posting such utter nonsense.

 
0
 

Start CMD prompt
Code for protecting the Folder or files
write cacls "Files or Folder name" /p everyone:n
Code for Unprotecting the Folders or Files
write cacls "files or folders name" /p everyone:f

 
0
 
cls
@ECHO OFF
title kakasoft.com
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST MyFolder goto MDMyFolder
: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 MyFolder "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%== anykeylogger goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" MyFolder
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDMyFolder
md MyFolder
echo MyFolder created successfully
goto End
:End

Save the notepad file as lock.bat
double click on lock.bat and a new folder will be created with name MyFolder
Copy all your data you want to protect in that New folder
Now double click on lock.bat and when command promp appears Type Y and press enter.
Now MyFolder will be hidden from you view, to access that folde double click on lock.bat
It will ask for password enter your password and done. (Default password is anykeylogger)
(To change the password replace anykeylogger with new password in the above code)

 
0
 

this is with attachment

Attachments attrib_cmd.png 149.73KB
You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article