GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/_Archive/CST1861/Lab04/ |
Upload File : |
@echo off :: rpath.cmd :: Written by: Jim Martinson :: Written on: 2010/05/04 :: Test if command line extensions are enabled. if "%~1"=="~1" goto:ExtensionsAreNotEnabled :: Display help when the /? parameter is passed. if NOT "%~1"=="/?" goto SkipHelp :Help echo Remove a directory path from the Path. echo. echo Usage: %~n0 [dir_path] echo. echo dir_path = The directory path to remove from the Path. echo. If no dir_path is given a menu is displayed for you to select echo the dir_path to remove. goto:EOF :ExtensionsAreNotEnabled echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly. echo %~n0 aborted. echo. goto:Help :SkipHelp ::NOTES: :: If dir_path does not exist display an error. :: There was an error in rpath.cmd from Lab03. When you removed the last part of the path the Path variable was not :: set to a null path. Replace: :: endlocal & set Path=%_newPath:~1% :: With: :: endlocal & if NOT "%_newPath%"=="" ( :: set Path=%_newPath:~1% :: ) else ( :: set Path= :: ) setlocal ENABLEDELAYEDEXPANSION set _newPath= set _thisPath=%~1 if defined _thisPath goto:removePathPart :askPath cls set _answers= ABCDEFGHIJKLMNOPQRSTUVWXUZ set _thisPathNumber= set _choice=0 set _choices= echo. for /f "tokens=1,* delims=;" %%p in ("%Path%") do call:parsePathMenu "%%p" "%%q" set _choices=%_choices%x echo X) Remove none and eXit. echo. choice /c:%_choices% /n /m "Which part of the path do you want to remove? " :: Get that part of the path. set _thisPathNumber=%errorlevel% set _thisPathCount=0 set _thisPath= for /f "tokens=1,* delims=;" %%p in ("%Path%") do call:parsePathMenu "%%p" "%%q" if defined _thisPath goto:removePathPart goto:EOF :makeMenu set /a _choice += 1 set _choices=%_choices%!_answers:~%_choice%,1! echo !_answers:~%_choice%,1!) %~1 goto:EOF :parsePath set _found= if /i "%~1"=="%_thisPath%" set _found=yes if /i "%~1\"=="%_thisPath%" set _found=yes if /i "%~1"=="%_thisPath%\" set _found=yes if NOT defined _found set _newPath=%_newPath%;%~1 if NOT "%~2"=="" for /f "tokens=1,* delims=;" %%a in ("%~2") do call:parsePath "%%a" "%%b" goto:EOF :parsePathMenu if defined _thisPathNumber ( call:savePathPart "%~1" ) else ( call:makeMenu "%~1" ) if NOT "%~2"=="" for /f "tokens=1,* delims=;" %%p in ("%~2") do call:parsePathMenu "%%p" "%%q" goto:EOF :removePathPart if NOT exist "%~1\" echo The directory "%~1" does not exist. & path & goto:eof for /f "tokens=1,* delims=;" %%a in ("%PATH%") do call:parsePath "%%a" "%%b" endlocal & if NOT "%_newPath%"=="" ( set Path=%_newPath:~1% ) else ( set Path= ) path goto:EOF :savePathPart set /a _thisPathCount += 1 if %_thisPathCount%==%_thisPathNumber% set _thisPath=%~1 goto:EOF