Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In the new CA3 folder, create an empty Word document named Template.doc You do n

ID: 3750517 • Letter: I

Question

In the new CA3 folder, create an empty Word document named Template.doc

You do not have Microsoft Word installed on your computer. To create the document, simple create a new text file and rename the file Template.doc (make sure the filename is not Template.doc.txt).

Write a simple batch file named LastName.bat, which accomplishes the following:

Welcomes the user

Prompts the user for a new filename and extension.

When the filename is entered, creates a copy of Template.doc, in the currently logged-on user’s Desktop. The copy of the Template.doc should use the name the user entered in the previous step.

You must use an environmental variable to determine the current user in order to dynamically copy Template.doc to any user’s Desktop.

Suppress prompting to confirm you want to overwrite an existing destination file.

HINT: When copying, if your source or destination has spaces in the path, surround your variable with double quotes: “%path%”

At the very top of your batch file, make sure you enter comments with the following information:

Your name (author’s name)

The date you created your batch file

A brief description of what your batch file does.

Figure 6 (below) provides an example of how the batch file should look when executed.

1. 2. At the root of your flash drive, create a new folder named CA3 In the new CA3 folder, create an empty Word document named Template.doc You do not have Microsoft Word installed on your computer. To create the document, simple create a new text file and rename the file Template.doc (make sure the filename is not Template.doc.txt) a. 3. Write a simple batch file named LastName.bat, which accomplishes the following: a. b. c. Welcomes the user Prompts the user for a new filename and extension. When the filename is entered, creates a copy of Template.doc, in the currently logged-on user's Desktop The copy of the Template.doc should use the name the user entered in the previous step i. You must use an environmental variable to determine the current user in order to dvnamically copy Template.doc to any user's Desktop ii Suppress prompting to confirm you want to overwrite an existing destination file ii HINT: When copying, if your source or destination has spaces in the path, surround your variable with double quotes: "%path%" 4. At the very top of your batch file, make sure you enter comments with the following information: Your name (author's name) b. a. The date you created your batch file A brief description of what your batch file does. c. d. Figure 6 (below) provides an example of how the batch file should look when executed. C:windows system321cmd.exe Copy-o-rama! This batch file will prompt you for a filename, then, it wil create a copy of Template.doc. which has the filename you echo entered! Please enter a new filename WITH extension: test.doc 1 file copied. Thanks!

Explanation / Answer

I have created the bat file.

Steps to follow:

Step 1: Create a folder in flash drive named CA3.

Step 2: Create a file named Template.doc ensure that there are no other file extension trailing behind the file name(You will see the icon change from text file to that of doc file).

Step 3: Create a text file and rename the file as LastName.bat(ensure that the extension is .bat instead of .txt)(You will see the icon change from text file to that of doc file).

Step 4: Copy and paste the following text (in Bold) into the .bat file by opening the bat file(right mouse click and edit):

@echo off

rem (Enter your name here)
rem (Date goes here)


echo Copy-o-rama! & echo.=================== & echo.This batch file will prompt you & echo.for a filename, then, it will & echo.create a copy of Template.doc, & echo.which is the file name you entered! & echo. & echo.
SET /P _variable=Please enter file name WITH extension:

xcopy "Template.Doc" "%userprofile%Desktop" /Y

echo %_variable% >> "%userprofile%DesktopTemplate.doc"

echo exiting..
timeout 5

Step 5: Enter your name and the date in the second and third sttements of the pasted text.

Step 6: Following are the explanation of different commands:

ECHO: used for displaying text and copying content in the file.

REM: to add comments in the batch file.

XCOPY: to copy the file from one location to another.

%userprofile%: To fetch the current user.

Timeout: To pause the batch file execution for specified amount of time(you can modify it as per requirement.)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote