Loading
Home › Computer Science Help › Part 1: CHANGENAMES.BAT Create a batch file CHANGENAMES.B...
Status: Assigned

Part 1: CHANGENAMES.BAT Create a batch file CHANGENAMES.BAT that does the following (note that %1, %2, and %3 refer to command line arguments passed to the batch file when executed): 1. Creates a set of %1 empty files with randomly generated names, with filename extension %2. 2. Uses the dir command to display a list of the file names. 3. Uses the pause command to pause execution until the user strikes a key. 4. Changes the filename extension of these files from %2 to %3. 5. Uses the dir command to display a list of the modified file names. 6. Pause 7. Uses the del /p to delete the files with extension %3. The /p option will cause the command to prompt for a confirmation before the deletion of each file.

Date Posted: 29/02/2020
Category: Computer Science
Due Date: 05/03/2020
Instruction
CIT 360 Spring 2020 Project #3 Due by Friday March 27th 2027 (Week 10) This project should be performed in groups of 2 students. Please be sure to prepare one single submission with both team members’ names on it. Overview Each group of 2 students will submit one zip file to Canvas named project3.zip This zip file should include the following… • CHANGENAMES.BAT • changenames.ps1 • pspause.ps1 • calc.ps1 • Readme.txt o Inside this Readme.txt file should be the names of both/all group members. ____________________________________________________ Part 1: CHANGENAMES.BAT Create a batch file CHANGENAMES.BAT that does the following (note that %1, %2, and %3 refer to command line arguments passed to the batch file when executed): 1. Creates a set of %1 empty files with randomly generated names, with filename extension %2. 2. Uses the dir command to display a list of the file names. 3. Uses the pause command to pause execution until the user strikes a key. 4. Changes the filename extension of these files from %2 to %3. 5. Uses the dir command to display a list of the modified file names. 6. Pause 7. Uses the del /p to delete the files with extension %3. The /p option will cause the command to prompt for a confirmation before the deletion of each file. Hints • type nul > x%random%.txt creates an empty file with a randomly generated name. The name will be of the form x34382.txt, where the number 34382 is randomly generated. There is a similar command in Linux/Unix called “touch” which creates an empty file. • A common loop when performing admin tasks on a collection of files is a loop that iterates over files in the current directory. For example: o for %%x in (*) do ( … ) • Note that this loop does not use the /L option. • If %%x represents the name of a file (name plus extension), then %%~nx represents the name of the file without the filename extension. Example Run C:\>changenames 3 blah bleah  run command caution: don’t use “bat” as one of the extensions  3 random .blah files 02/18/2015 08:22 AM 0 f2567.blah 02/18/2015 08:22 AM 0 f29221.blah 02/18/2015 08:22 AM 0 f4481.blah 3 File(s) 0 bytes Press any key to continue . . .  pause  files renamed 02/18/2015 08:22 AM 0 f2567.bleah 02/18/2015 08:22 AM 0 f29221.bleah 02/18/2015 08:22 AM 0 f4481.bleah 3 File(s) 0 bytes Press any key to continue . . .  pause C:\\f2567.bleah, Delete (Y/N)? y  deleting with confirmation C:\\f29221.bleah, Delete (Y/N)? y C:\\f4481.bleah, Delete (Y/N)? y  dir is empty (except .bat) 02/18/2015 08:23 AM . 02/18/2015 08:23 AM .. 02/13/2015 08:22 AM 237 changenames.bat 1 File(s) 237 bytes Press any key to continue . . .  pause C:\>  done ____________________________________________________ Part 2: changenames.ps1 and pspause.ps1 Write a PowerShell script changenames.ps1 to repeat the task of the CHANGENAMES.BAT batch file. Note that there is no “pause” command in PowerShell, so you should write your own, with help from Google. Organize this as a separate script file pspause.ps1 and call this script file from the changenames.ps1 script file. NOTE: you may not call any .bat file from either .ps1 file. (You must solve the pause problem another way.) ____________________________________________________ Part 3: calc.ps1 Write a PowerShell script named calc.ps1 that performs simple arithmetic calculations of the form > calc 3 + 4 7 > calc 8 * 3 24 … You need only support +, -, *, and / operations. _________________________________________________ PowerShell Basics Script Structure param($p1,$p2,…)  list of params at the top function f($a,$b,$c) {  some function … $result = … … Write-output $result } … function g(…) {  another function … } … main program …  the actual script starts here Comments # this is a one liner <# this spans multiple lines #> Comparisons –eq –ne –lt –le –gt –ge Boolean Operations –and –or –not Boolean Constants $true $false Loops $i = 1 while ($i –le 10) { Write-output $i $i++ } If-Else if (…) { … } elseif (…) { … } elseif (…) { … } Calling a Function function f($a, $b, $c) { … return … } $x = f 1 2 3  don’t write f(1,2,3)
Tutor Uploads
No File uploaded yet.
Bidders
smartestwriter 6 years, 7 months ago
Rated 9.54 earned 25983.04 around 898 assignments.
Hello dearest customer, I have gone through the instructions on your assignment and understood them. I will follow the instructions keenly and support the paper with credible in-text citations and references. I will deliver the homework in a timely manner with zero plagiarism. Kindly assign the homework to me and I will not let you down. Thank you in advance.
$250.00
  • {$ item.message_content $}
    {$ item.sender_username $} | {$ item.date_entered $}
 
 
phoniextutor 6 years, 7 months ago
Rated 8.98 earned 50856.21 around 1767 assignments.
Hello my friend, kindly offer me this gracious opportunity to assist you. Pleasure.
$300.00
  • {$ item.message_content $}
    {$ item.sender_username $} | {$ item.date_entered $}
 
 
harvardtutor 6 years, 7 months ago
Rated 8.93 earned 38096.91 around 1156 assignments.
Hello, You can be rest assured have checked the assignment requirements /instructions and am well versed and competent to deliver on the field subject. I guarantee timely delivery and a plagiarism free paper. Thank you in advance for your faith in me.
$350.00
  • {$ item.message_content $}
    {$ item.sender_username $} | {$ item.date_entered $}
 
 
academicminded 6 years, 7 months ago
Rated 9.5 earned 87858.79 around 3236 assignments.
I have a PhD in this field and I can assure you quality free work , from plagiarism and delivered on time . Kindly assign me . Regards
$1000.00
  • {$ item.message_content $}
    {$ item.sender_username $} | {$ item.date_entered $}
 
 
Primetutor 6 years, 7 months ago
Rated 9.2 earned 5229.67 around 164 assignments.
Hi friend. I have read and understood the prompts. I am highly competent and experienced in this field.Please assign me the task and i will deliver the best. I will carefuly follow instructions to ensure that i deliver excellent work that will earn you great grades.
$25.00
  • Hello
    Primetutor | Feb 29, 2020, 23:43 PM
  • hello
    Primetutor | Feb 29, 2020, 23:43 PM
  • Hello
    User_25317 | Feb 29, 2020, 23:46 PM
  • Can you please update me on the progress Thank You
    User_25317 | Mar 02, 2020, 20:46 PM
  • Working on part 1
    Primetutor | Mar 03, 2020, 04:27 AM
  • is the part 1 finished? this is past due date
    User_25317 | Mar 11, 2020, 15:18 PM
  • {$ item.message_content $}
    {$ item.sender_username $} | {$ item.date_entered $}
 
  Assigned to Primetutor