@echo off title File and Folder locker by ALEEF02 color 0a echo Lock or unlock? (L/U) set /p sel= if %sel% == L goto lock if %sel% == l goto lock if %sel% NEQ L goto unlock :lock echo ----------------------------------------------------------------------- echo What's the EXACT name of the file (with extension if not a folder!) set /p name= echo ----------------------------------------------------------------------- echo Type the EXACT (If you don't, files can be lost!) Path! echo ----------------------------------------------------------------------- echo Example: %USERPROFILE%\Desktop\Secrets or %USERPROFILE%\Desktop\"Secret Folder" (Use " When there is a space) set /p item= echo ----------------------------------------------------------------------- echo Does this look right? (Y/N) echo ----------------------------------------------------------------------- echo %item% set /p sel= if %sel% == Y goto continue if %sel% == y goto continue if %sel% NEQ Y goto lock :continue echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs echo sLinkFile = "%HOMEDRIVE%%HOMEPATH%\Desktop\%name%.lnk" >> CreateShortcut.vbs echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs echo oLink.TargetPath = "%item%" >> CreateShortcut.vbs echo oLink.IconLocation = "C:\Windows\System32\shell32.dll, 109" >> CreateShortcut.vbs echo oLink.Save >> CreateShortcut.vbs cscript CreateShortcut.vbs del CreateShortcut.vbs attrib +s +h "%item%" cacls %item% /t /e /p everyone:n echo ----------------------------------------------------------------------- echo Done! Come back to unlock the file pause exit :unlock echo ----------------------------------------------------------------------- echo What's the EXACT name of the file (with extension if not a folder) set /p name= echo ----------------------------------------------------------------------- echo Type the EXACT Path! echo ----------------------------------------------------------------------- echo Example: %USERPROFILE%\Desktop\Secrets or %USERPROFILE%\Desktop\"Secret Folder" (Use " When there is a space) set /p item= cacls %item% /t /e /p everyone:f attrib -s -h "%item%" del /q %name%.lnk echo ----------------------------------------------------------------------- echo Done! Come back to lock the file pause exit