我用“NTFS 锁”锁定了一个重要文件夹源码,但现在它已被隐藏并锁定,解锁不起作用。我尝试使用cmd
并查找了一些教程,但都没有用。我记得文件夹的路径,访问文件夹很容易,但我怎样才能让它再次出现并取消隐藏?
答案1
该工具使用内置权限和文件属性来隐藏和锁定文件。
从项目网站上的评论来看 My folder will not unlock. Very bad. Posted 08/03/2016
,该程序似乎不完整,或者没有遵循说明。
首先,查看有问题的隐藏文件/文件夹:
点击❖ Start
→ 点击Search
→ 输入:Folder Options
→ 点击Folder Options
列表 → 选择View
选项卡 → 勾选Show hidden files, folders, and drives
。
如果您的文件/文件夹没有显示,也请取消勾选,Hide protected operating system files (Recommended)
以防软件将它们标记为“系统”文件。
编辑:正如评论部分所指出的,锁定似乎是通过 Windows 的内置安全设置实现的。用户将看到通用的“拒绝访问”消息。您需要更改文件/文件夹安全设置才能解决此问题。
尝试更改相关文件夹/文件的安全设置时,您将看到此内容,而不是正常、简单且更熟悉的安全设置窗口:
您要做的是添加您的组或用户名以获得“完全控制”权限。
单击Continue
按钮以提升您的权限 → 单击Add
→ 单击Select a principle
链接。之后,您必须输入您的完全合格的用户名/组。单击Check Names
将帮助您解决该问题。OK
完成后单击。
完成后,再勾选权限Full control
,会勾选下面所有的权限,点击OK
→ Apply
→ OK
:
您应该能够进入文件夹或访问文件。如果无法进入,请再次验证您的权限。
网页链接:
答案2
尝试一下我的批处理文件夹锁定脚本:
@echo off & title Folder Locker & pushd "%~dp0" & color 0a
::****************************************************************
openfiles >nul 2>&1 & if %errorlevel% EQU 1 (
setlocal disableDelayedExpansion & color 4f
echo Running Admin Shell, Please wait.... & ping localhost -n 1 >nul
set "bPath=%~f0" & setlocal enableDelayedExpansion
echo Dim UAC : Set UAC = CreateObject^("Shell.Application"^) >Elevate.vbs
echo For Each strArg in Wscript.Arguments >>Elevate.vbs
echo args = args ^& strArg ^& " " >>Elevate.vbs
echo Next >>Elevate.vbs
echo UAC.ShellExecute "!bPath!",args,"","runas",1 >>Elevate.vbs
echo Set objShell = Nothing >>Elevate.vbs
cscript //nologo Elevate.vbs & del Elevate.vbs & exit /b
)
::****************************************************************
if not exist "%userprofile%\desktop\%~n0.lnk" (
(
echo Call Shortcut("%~f0","Folder Locker"^)
echo Sub Shortcut(Application,Name^)
echo Dim objShell,DesktopPath,objShortCut,MyTab
echo Set objShell = CreateObject("WScript.Shell"^)
echo MyTab = Split(Application,"\"^)
echo If Name = "" Then
echo Name = MyTab(UBound(MyTab^)^)
echo End if
echo DesktopPath = objShell.SpecialFolders("Desktop"^)
echo Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Name ^& ".lnk"^)
echo objShortCut.TargetPath = Chr(34^) ^& Application ^& Chr(34^)
echo ObjShortCut.IconLocation = "shell32.dll,47"
echo objShortCut.Save
echo End Sub
) >>crshort.vbs
cscript //nologo crshort.vbs & del crshort.vbs
)
::**************************************************************
mode 160,40
if not exist "%userprofile%\id.spfile" goto first_lock
goto :Unlocker_Password
:first_lock
cls & echo. & echo.
echo #########################################
echo Welcome to Folder Locker
echo #########################################
echo.
echo No Private Folder was found, a folder is needed to be created
echo.
Call :InputPassword "Create a strong password for the locker"
::**************************************************************
cls & echo. & echo.
echo Please choose a folder where to create the locker, a dialog box will come:
Call :ChooseFolder "%Userprofile%\Desktop" "Choose the folder where the hidden folder locker will be created, preffereably choose an unpredictable secure location, though it will be completely hidden"
cls
::**************************************************************
echo #########################################################################
echo Creating the private folder, please wait.....
echo #########################################################################
echo.
type nul >"%userprofile%\id.spfile"
md "%folder%\SecretLocker" & md "%AppData%\Wasif"
echo %password% >"%AppData%\Wasif\pwd.spfile"
echo %folder% >"%AppData%\Wasif\folder.spfile"
call :LockFolder "%AppData%" "Wasif"
call :LockFolder "%folder%" "SecretLocker"
ping localhost -n 2 -w 1000 >nul 2>&1
::*************************************************************
cls
echo Creation of the private folder was done
echo To work with the folder, re-launch this (%~nx0) batch file
echo Then input the password again and options will come
echo.
pause >nul | echo Press any key to quit.....
exit /b 0
::***********************************************************
:Unlocker_Password
::***********************************************************
cls & echo. & echo.
Call :InputPassword "Enter your password"
Call :UnlockFolder "%Appdata%" "Wasif" False
set /p actpassword=<"%Appdata%\Wasif\pwd.spfile"
if %actpassword%==%password% (goto :Unlocker_Menu)
goto :Bad_Password
::***********************************************************
:Bad_Password
color 0c & cls
echo Bad password entered
pause >nul | echo Press any key to quit.....
Call :LockFolder "%Appdata%" "Wasif"
exit /b 0
::***********************************************************
:Unlocker_Menu
cls & color 0a & echo. & echo.
for /f "tokens=* delims= " %%a in ('type "%Appdata%\Wasif\folder.spfile"') do set "folder=%%a"
echo ###################################
echo Folder Locker Menu
echo ###################################
echo Private folder is in: %folder:~0,-1%
echo.
echo [1] Unlock Private folder
echo [2] Unlock Private folder and open in explorer
echo [3] Change password
echo [4] Delete Private folder
echo [5] Lock and Quit (Recommended you quit from here)
choice /c 12345 /n
goto %errorlevel%
::***********************************************************
:1
Call :UnlockFolder "%folder:~0,-1%" "SecretLocker" False
cls & echo Unlocked!
pause & Goto :Unlocker_Menu
::***********************************************************
:2
Call :UnlockFolder "%folder:~0,-1%" "SecretLocker" True
cls & echo Unlocked!
pause & Goto :Unlocker_Menu
::***********************************************************
:3
Call :InputPassword "Enter new password"
echo %password% >"%Appdata%\Wasif\pwd.spfile"
cls & echo Changed password!
pause & goto :Unlocker_Menu
::***********************************************************
:4
Call :Unlock_Folder "%folder:~0,-1%" "SecretLocker" False
rd /s /q "%folder:~0,-1%\SecretLocker"
rd /s /q "%Appdata%\Wasif"
del /f /q "%userprofile%\id.spfile"
cls & echo Deletion was successful!
pause >nul | echo Press any key to quit...
exit /b 0
::***********************************************************
:5
Call :LockFolder "%Appdata%" "Wasif"
Call :LockFolder "%folder:~0,-1%" "SecretLocker"
exit /b 0
::***********************************************************
:: Functions
::************************************************************
:ChooseFolder <StrInitialFolderPath> <StrDescription>
for /f "usebackq tokens=* delims=" %%a in (`powershell -Command "& {Add-Type -AssemblyName System.windows.forms;$f=New-Object System.Windows.Forms.FolderBrowserDialog;$f.SelectedPath='%~1';$f.Description='%~2';$f.ShowDialog();$f.SelectedPath}"`) do set "folder=%%a"
exit /b 0
::************************************************************
:LockFolder <StrParentFolderPath> <StrFolderName>
set "alias=AnonymousHacker.{2227A280-3AEA-1069-A2DE-08002B30309D}"
ren "%~1\%~2" "%alias%" >nul 2>&1 & attrib +r +s +h "%~1\%alias%" >nul 2>&1
icacls "%~1\%alias%" /deny Users:F >nul 2>&1 & exit /b 0
::************************************************************
:UnlockFolder <StrParentFolderPath> <StrOldFolderName> <BoolOpenInExplorer>
set "alias=AnonymousHacker.{2227A280-3AEA-1069-A2DE-08002B30309D}"
icacls "%~1\%alias%" /grant Users:F >nul 2>&1 & attrib -r -s -h "%~1\%alias%" >nul 2>&1
ren "%~1\%alias%" "%~2" >nul 2>&1 & if '%~3'=='True' (explorer "%~1\%~2")
exit /b 0
::************************************************************
:InputPassword <StrPrompt>
for /f "tokens=* delims=" %%a in ('powershell -command "& {$Password=read-host '%~1' -AsSecureString;$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password);[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)}"') do set "password=%%a"
exit /b 0
::************************************************************
这将创建一个私人文件夹并提示用户选择密码和位置。
- 它将重命名私人文件夹,并
AnonymousHacker.{2227A280-3AEA-1069-A2DE-08002B30309D}
用 PrintHood 替换其中的内容。 - 然后添加属性只读,隐藏和系统文件。
- 然后拒绝用户组对其的完全访问。
如果您在批处理文件中输入密码,它可以在需要时解锁并打开文件夹。还可以更改密码并将其删除。创建桌面快捷方式。