1. Create a batch file (hw3_yourlastname1.bat) which will schedule tasks on the
ID: 3591046 • Letter: 1
Question
1. Create a batch file (hw3_yourlastname1.bat) which will schedule tasks on the system using Windows 7’s Scheduled Task Console utility - schtasks (60%) Your batch file (hw3_yourlastname1.bat) will include instructions to do the followings:
i. List the directories and files in the current directory
ii. Pause the script to see the list of directories and files
iii. Clear the screen iv. Pause the script
v. Schedule a task to start Check Disk (chkdsk.exe) every Friday at 5:30pm using Scheduled Task Console
vi. Schedule a task to start Disk Defragmenter (dfrgui.exe) every 1 st day of a month at 11:30pm using Scheduled Task Console
vii. Display all the scheduled tasks on the system
viii. Pause the script to see the list of scheduled tasks
2. Windows Script Host (WSH) facilitates developing scripts for Windows 7 using scripting languages such as Visual Basic.
a. Write down a visual basic script (hw3_yourlastname2.vbs) which will display the current user’s login name, computer name, domain name and user profile (home folder) in a message box (20%)
b. Write down a visual basic script (hw3_yourlastname3.vbs) which will list all the printers (including virtual ones such as Adobe Writer) and their assigned port(s) defined on your machine (20%)
Explanation / Answer
The following is the required Bash Script :
hw3_yourlastname1.bat
@echo off
for /r %%a in (*) do echo %%a >> get_files.txt %% this line of code brings all the file and folder
type get_files.txt %% this line store the file and folder details in .txt file and show
pause %% Pause
test&cls %% Clear the Screen
pause %% Pause
echo y | chkdsk.exe c:1 %% Task Scheduler set with the command for Check Disk
echo y | Defrag.exe c:1 %% Task to Defrag command set in Task Scheduler
ECHO Task to Check Disk %% Print the task that we have to perform in the script
ECHO Task to Defrag %% Print the task that we have to perform in the Script
pause %% Pause
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SInce the first question has more than 4 subparts.
According to Chegg QA policy, The second and third question cannot be answered here.
Please post separate question for them.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.