SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

[Work Efficiency] "Wait, is this magic?" The story of the shock of using a "Windows Batch" file to finish manual folder creation in an instant



Small talk: The sound of spring's footsteps and the sound of the end of the fiscal year's footsteps

Hello everyone. Good evening. Good morning.

We are reaching the end of February, and the footsteps of the end of the fiscal year are finally approaching right before our eyes.

Recently, it has been getting warmer little by little, and the scent of spring has started to mingle with the morning air. On my days off, I go to a nearby park with my children, where I lose track of time pushing them on the swings or playing tag with them innocently. These days, I deeply feel that "these casual moments are probably the greatest happiness of all."

On the other hand, when it comes to the "end of the fiscal year" in schools, it is already a storm of busyness, isn't it?
The final push for grading, the creation of guidance records where absolutely no mistakes are allowed, and the preparation of huge amounts of handover materials for the next fiscal year...

As I am in charge of ICT, this time of year finds me running around the staff room, dealing with inquiries from teachers such as "How do I migrate this data?" or "What about preparations for next year's Classroom?" as well as preparing the environment for the next fiscal year.

How to leave at "regular time" and create time for my family and "margin" for myself. This is an eternal theme for me, and also a battle.

Well, today I would like to talk about a shocking experience I had in the staff room during that "end-of-year environment preparation" where I couldn't help but shout out loud, "Wait, is this magic!?"

It is a story about how "that simple task" that I used to give up on and waste time on every year as "unavoidable" came to be finished with just one click, in "one second".

Chapter 1: The nightmare of "folder migration" that haunts the ICT person in charge

At the end of the fiscal year, I, as the person in charge of ICT, had a major mission that I absolutely could not avoid.
That is the task of "creating and migrating folders in the shared server for the next fiscal year."

At our school, a huge amount of data is saved in shared folders by grade and department. Inside the main folder called "Reiwa 7 Fiscal Year," there are countless hierarchies such as "1st Grade," "2nd Grade," ... "Academic Affairs," "Student Guidance," and "Research," and within those, even more detailed folders like "1st Semester," "2nd Semester," "Meeting Minutes," and "Handouts" exist like a maze.

For the next fiscal year, there is definitely a situation in your workplace too where you think, "I want to empty the contents (files) and copy just the folder structure (framework) as it is for 'Reiwa 8 Fiscal Year'."

Until now, I had been doing this task purely by "manual labor with spirit and guts."

"Right-click -> New -> Folder -> Change name to 'Reiwa 8 Fiscal Year'..."
"Open the previous folder in a separate window, select the necessary folders, copy them, paste them into the new folder... oh, I accidentally copied the files too, so I have to go inside and press the delete key one by one to erase them..."

Or, as the quickest (or so I thought) method, it is a mind-numbing brute-force technique of copying the entire Reiwa 7 folder and then selecting all the files inside to delete them.

However, with this method, you end up copying all the heavy data from the previous year (including videos and a large number of photos) once, so you end up just staring blankly with a hollow face at that Windows progress bar that says "Copying... about 45 minutes remaining." Moreover, it often stops midway with errors like "File name is too long," which makes me break into a cold sweat.I often break into a cold sweat.

"This is such a huge waste of time... But since the teachers for next year will be in trouble, someone has to do it..."

That was when I was half-resigned, clicking my mouse in vain.

Chapter 2: The Savior of the Staff Room and the One-Second Magic

As I was sighing heavily and glaring at the "30 minutes remaining" display on my screen, another teacher who is also in charge of ICT (let's call him Mr. T) walked by.

Mr. T: "Mr. Pre-Flo, you look tired. What are you doing, glaring at the screen?"

Me: "Oh, Mr. T... I'm creating the folder structure for the 2026 school year. I want to transfer the structure from the 2025 school year as it is. But the data is so heavy that copying it takes an incredibly long time. I don't need the files inside, just the empty folders..."

Then Mr. T grinned a little and said something unbelievable.

"Oh, in that case, you can create a 'batch' file and do it in an instant."

Me: "...a batch?"

Mr. T stood in front of my computer, said "Let me borrow it for a second," and slowly opened Windows "Notepad." After checking the current folder location on the black screen (Command Prompt), he began typing just two or three lines of English text into Notepad.

It took about a minute. Mr. T saved the Notepad file to the desktop with an unfamiliar name: "Create Next Year Folders Instantly.bat".

Mr. T: "Mr. Pre-Flo, try double-clicking this gear-like icon."

Just as I was told, the moment I skeptically double-clicked the icon, it happened.

For a split second, a pitch-black screen popped open, and a waterfall of text like something out of The Matrix flowed by, only to vanish in 0.5 seconds.

Thinking, "Wait, did it crash with an error?" I opened the shared server and...

The "2026" folder, which I had despaired would take dozens of hours to create, had been perfectly completed, with all hundreds of subfolders intact, all empty.

Me: "What!? W-what is this!? Wait, is this magic!?"

Mr. T: "Hehe. This is a 'Windows batch'. It's like a letter written directly to the computer, commanding it to 'do this task under these conditions.'"

I felt like I had been struck by lightning. I had been sharing the wonders of generative AI (like Gemini and NotebookLM), but I had no idea that such tremendous automation power was sleeping within the very "Windows" OS I use every day as naturally as breathing.

Chapter 3: Easy for Beginners! What is a "Windows Batch"?

To convey this thrilling experience to everyone, I immediately used the power of generative AI to thoroughly research "Windows batches." I will explain it clearly using analogies, omitting technical jargon as much as possible so that it makes sense to us teachers.

1. The difference between "mouse operations" and "command operations"

When we use a computer, we usually use a mouse to "right-click an icon, select copy, open another screen, and paste." This is called GUI (Graphical User Interface).
To use an analogy, it's like "taking a new teacher by the hand, walking them all around the school building, and explaining one by one, 'This is the staff room, and this is the printing room.'" It is intuitive and easy to understand, but it takes time for both the guide (the computer) and the person being guided.

On the other hand, for the inside of a computer (such as the command prompt), receiving this as "text commands" is overwhelmingly faster to process. This is called CUI (Character User Interface) or CLI. To use an analogy, it's like "handing over a perfect instruction sheet (text) that says, '1. Enter the main gate, 2. Go 10m to the right, 3. Go up the stairs to the second floor.'" Since there is no need to draw unnecessary scenery (graphics), the computer reaches the destination at super-high speed the moment it sees the instruction sheet.

② What is a batch file? A "magic instruction manual"

A "batch file (a file with a .bat extension)" is an "automatic execution program" that has instructions written and saved in this text format, telling the computer, "Execute these commands in this order all at once."

In fact, this mechanism is a very historic technology that has existed since the MS-DOS era of the 1980s. Do not underestimate it as "old technology." Even in today's latest Windows environments, it is an extremely important core technology that professional engineers use every day for system management and automating routine tasks.

The greatest appeal of a batch file is that it can finish simple tasks that would require dozens or hundreds of mouse clicks in just one click (one second). It feels exactly like hiring a super-efficient office assistant for free who works at the speed of light without a single complaint.

Chapter 4: Practice! How to create a "folder structure copy batch" you can use starting tomorrow

"I understand the logic, but programming seems difficult..."
To the teachers who feel that way, don't worry. No special software is required at all. You can create it right now using just the "Notepad" already installed on your Windows computer.

This time, I will introduce the magic spell that T-sensei taught me: "Ignore the files inside and copy only the folder structure (empty folders)."

STEP 1: Open Notepad

Click the Windows Start button and open "Notepad" from "All apps" or the search bar.

STEP 2: Paste the spell (command)

Please copy and paste the following three lines of text into Notepad as they are.

@echo off
xcopy "C:\令和7年度" "C:\令和8年度" /T /E
pause

[Explanation of the spell]

  • @echo off : A magic word that means "you don't need to display unnecessary text on the screen while working."

  • xcopy : This is the star of the show. It is a command that means "perform an advanced copy."

  • "C:\Reiwa 7th Fiscal Year" : This is the location (path) of the source folder. (*Please change this according to your own environment.)

  • "C:\Reiwa 8th Fiscal Year" : This is the location (path) of the destination folder.

  • /T : This is the most important part! It is an option instruction that means "ignore the files inside and copy only the folder structure (tree)."

  • /E : This is an option that means "include all folders, even those that are empty, without omitting them."

  • pause: This is an instruction that says, "When the process is finished, don't close the window automatically; instead, display 'Press any key to continue' and wait." Having this allows you to check for errors if they occur.

STEP 3: Save with a name (This is the most important part!)

Select "File" in the top left of Notepad, then "Save As".

Here, name the file something like CreateFolders.bat, and make sure to end it with .bat (dot-b-a-t) when saving. (If you leave it as .txt, it will just be a regular text file.)

⚠️ Troubleshooting when things don't go as planned

If it doesn't work, try checking the following three points.

  1. Path separator: The \ (backslash) used to indicate folder locations is entered and displayed as ¥ (yen mark) on Japanese keyboards. Both have the same meaning, so it's fine.

  2. Garbled text and it won't run: If you are using Japanese (kanji, etc.) in folder names, the character encoding used when saving might be the cause. Try changing the "Encoding" at the bottom of the "Save As" screen from UTF-8 to "ANSI" or "Shift-JIS" and save it again.

  3. "Access Denied" error: It might be blocked by strict settings on a shared server. In that case, try right-clicking the batch file and selecting "Run as administrator".

Since you might panic if you fail while working directly on the actual shared server, I strongly recommend creating a "Test Source" and "Test Destination" folder on your desktop and practicing there first!

Chapter 5: There's more! A collection of "1-second magic" tricks recommended for teachers

For those of you thinking, "Can this be used for things other than copying folders?" Absolutely! Most routine tasks in the school environment that you find "troublesome" can be instantly eliminated with a batch file. Here are two that are easy to use.

Magic #1: The "Cleanup Batch" that tidies up your desktop in an instant

Have you noticed your desktop getting buried in PDF files and images? If you save the following code as a .bat file and run it, it will instantly move (clean up) all PDF files on your desktop to a specified folder.

DOS

@echo off
move "%USERPROFILE%\Desktop\*.pdf" "%USERPROFILE%\Desktop\PDF整理フォルダ"

Magic #2: The "Batch Launch" that automates your morning preparation

When you arrive at work in the morning and open your computer, do you open the attendance system, school administration system, Google Classroom, and today's schedule in Excel one by one? If you run the following batch file, all the apps and websites you use every morning will launch "all at once with a single click."

DOS

@echo off
start chrome "[https://classroom.google.com/](https://classroom.google.com/)"
start chrome "https://あなたの学校の校務システムURL"
start excel "C:\Users\Desktop\今週の時間割.xlsx"

Chapter 6: The ultimate tag team of AI and batch files

Now, for those teachers who have read this far and thought, "I understand how amazing batch files are, but I'm too busy to study and memorize those English spells (commands)!" You are sharp. I completely agree. There is no need to memorize grammar from scratch.

This is because we now have the ultimate personal programmer, "Generative AI (Gemini, Claude, or ChatGPT)," by our side.

Just by telling the AI what you want to do in plain language, it will write the perfect batch file code for you in seconds. However, there is a small trick to asking the AI (the prompt).

❌ Bad prompt example

"Make a batch file to organize the files in the folder." (*The AI will be confused, asking "Which folder? How should I organize them?" and will output irrelevant code.)

⭕ Good prompt example (Clarify the 5W1H)

"I want to create a Windows batch file. Please write code that meets the following conditions and explain how to use it for a beginner. - Purpose: Extract only all 'image files (.jpg and .png)' from a folder named 'Reiwa 7' on the desktop. - Process: Move those images to a new folder named 'Photo Archive'. - Note: Please ensure that character encoding issues are avoided."

In this way, if you provide clear instructions in bullet points regarding "prerequisites (where it is)," "processing details (what to do and how)," and "output results (where to move it)," it will give you perfect, ready-to-use code on the first try. If an error occurs, just copy and paste the error message to the AI, and it will immediately suggest a corrected version.

In other words, we have become able to run the ultimate efficiency cycle: "We humans think of what we want to do (requirements definition), we have the AI write the tedious code, and we leave the actual work (execution) to the batch file."

Chapter 7: "What will you do with the efficiency you've gained?" ~The "margin" we should create~

Thanks to Mr. T, I was able to finish a simple task that should have taken several hours in just a few minutes (the execution itself took only one second).

However, there is an essential point we must not forget here. That is, "What will you do with the time you've gained through efficiency?"

Using ICT tools and batch files to finish work quickly is a wonderful thing. But if you use that free time to think, "Alright, now that I have time, let's pack in more administrative tasks or meetings," that defeats the purpose. That is not work-style reform.

What we should be striving to create through work efficiency is "margin."

  • Time to carefully think about the points where children are struggling in class and ask, "How can I explain this more interestingly?" (teaching material research)

  • Time in the staff room to chat with a colleague with a smile, saying, "Today, a student in my class said something so wonderful."

  • Time to leave school on time, walk under a slightly bright sky, and sit around the dinner table with your family with a smile.

I strongly believe that this is the most precious thing we should obtain, even if it means using AI and ICT to the fullest.

Let's leave the "simple, repetitive, and massive" tasks that computers are good at to computers and AI. And let's pour our limited energy and affection into the "warm interactions with children" and "creative thinking" that only we, as human teachers, can provide.

Summary: There is still so much "learning" we don't know yet

This experience was a very fresh surprise for me. I never imagined that such a powerful and convenient feature had been hidden all along in the Windows PC I use every day as a matter of course. And I am full of gratitude to Mr. T, who taught it to me casually, without even a hint of arrogance.

As we get older and become accustomed to our work to some extent, we tend to cling to "our own way of doing things." We stop questioning inefficient methods, telling ourselves, "This is the most reliable way." However, I have been made to realize that by broadening our perspective a little, asking others for help, and being open to trying new tools and technologies, our world can change dramatically.

Moving forward, with the themes of "AI" x "hands-on education" and "greedily absorbing new technology", I would like to continue exploring what a "just right" classroom and staff room should look like for both the children and us teachers.

If you also feel like you're about to break down while organizing folders at the end of the fiscal year, please try the magic of this "Windows batch" file! It will change your world.

See you next time!! If you liked this, I would be encouraged if you could support me with a like or a share!


#WorkStyleReform #ICTUtilization #WorkEfficiency #ElementarySchoolTeacher #WindowsBatch #GenerativeAI #Claude #Gemini #StaffRoom #TeachersDailyLife #ProgrammingBeginner #EducationDX #CreatingSpace

いいなと思ったら応援しよう!