by knicknak » Fri Mar 05, 2010 8:45 am
Copy and paste this into notepad, edit for your custom password and folders, save the file as CreatePassword.bat
Double-click or run from the command line.
Note: This batch file creates circular junctions, some programs that scan folders (backup, virus scan) may get confused if they don't handle junctions well.
Enjoy
:: PS3 Media Server compatible password scheme
:: Author: Knicknak
::
:: Use: Edit this file with your custom information
:: Run this file to create the password scheme
:: Share \#EnterPassword# on PS3 Media Server
:: From your PS3 navigate through the following sequence: #EnterPassword#->Password One letter at a time->#submit#
::
:: Caveats: The PS3 remembers the path you took when entering the password, so after you are done with the files in the
:: protected folder, you need to either:
:: - Reset your Media Server (#-Video Settings-#, Restart HTTP Server)
:: OR
:: - Turn off the PS3
:: OR
:: - Get rid of the path by navigating backwards using a sequence like this:
:: Circle, !, Circle, Circle, !, Circle, Circle, ! ... back to the root media server folder
::
:: The PS3 has a limitation of 7 levels of folders
:: This means that your password length is limited by the number of folders you plan to use
:: e.g. #EnterPassword#->p->s->w->r->d->#submit# is 7 levels deep, so no subfolders with a 5 charater password
:: #EnterPassword#->p->s->w->d->#submit# is 6 levels deep, so you could have a layer of subfolders.
::
:: PS3 Media Servers's #transcode# is a subfolder, so if you need to access this for your media you need to
:: factor that into your password length
::
::
:: This batch file is designed for Vista and Windows 7 which include mklink
::
:: For XP you can download the Windows Server 2003 Resource Kit Tools
:: and modify the junction and options to be linkd and blank
:: Set restrcitedDir to the existing folder on your file system that you want to protect
SET restrcitedDir="\Restricted Folder"
:: Set password to your own characters seperated by commas. 5 characters or less - see why above.
SET password=p,s,w,d
:: Default is for Vista/Windows 7, for XP SET junction=linkd SET options=
SET junction=mklink
SET options=/J
SET pwdDir=\#EnterPassword#
SET chars=#submit#,!,#,$,%%,@,[,],-,_,`,{,},~,+,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9,0
mkdir %pwdDir%
cd %pwdDir%
for %%a in (%password%) do (
mkdir %%a
for %%b in (%chars%) do IF NOT EXIST %%b %junction% %options% %%b %pwdDir%
cd %%a
)
%junction% %options% #submit# %restrcitedDir%
for %%a in (%chars%) do IF NOT EXIST %%a %junction% %options% %%a %pwdDir%
:: If you have subfolders that you want to link to your protected folder, add them below
:: realize that having a level of subfolders reduces the length of the password allowed
cd %restrcitedDir%
REM %junction% %options% AnyFoldername PathToAnyFolder
REM %junction% %options% AnotherFoldername PathToAnotherFolder