❓ Help CMD how to do this?

Translucent B

Established
How to do this mga ka phc? dapat daw nagccreate yung bat file kapag inopen. ty sa sasagot!

1. Create a .bat file that performs the following tasks:

o Generates a main directory named Activity in the user's Documents folder.

o If the directory already exists, delete it first (including all its contents) before recreating it.

2. Inside this main directory, create three subfolders with the following conditions:

o Prelim (Folder1) — This folder should have hidden attributes.

o Midterm (Folder2) — This folder should be marked as read-only.

o Finals (Folder3) — This folder should be set as a system folder (requires administrative privileges).

3. Within each folder, create a text file with the following names and content:

o Inside Prelim: "Prelim Activity.txt" with the content: "This is all my activity in prelim."

o Inside Midterm: "Midterm Activity.txt" with the content: "This is all my activity in midterm."

o Inside Finals: "Final Activity.txt" with the content: "This is all my activity in final."

4. Replace Operation:

o In each text file, replace all occurrences of the word "activity" with "task", but only if the file size is less than 100 bytes.

o After replacement, append the text " - Edited on [current date and time]" at the end of each file.

5. Remove Operation:

o Check if the Finals folder contains any files larger than 50 bytes. If so, delete only those files.

o If no such files are found, delete the entire Finals folder.
 

About this Thread

  • 0
    Replies
  • 325
    Views
  • 1
    Participants
Last reply from:
Translucent B

Trending Topics

Online now

Members online
962
Guests online
1,557
Total visitors
2,519

Forum statistics

Threads
2,273,356
Posts
28,948,970
Members
1,235,715
Latest member
mjsimborio2
Back
Top