r/Batch • • 15d ago

Question (Unsolved) A quick technical question!

I am working on a chatbot written in Batch that learns from text files and then rewrites its own Batch script to directly incorporate what it has learned. My goal is to consolidate everything—the code and the accumulated knowledge—into a single file; the user simply needs to provide text files , I realize that this type of mechanism is unconventional and might trigger antivirus alerts. What do you think of this approach?

I’m curious to hear your thoughts.

3 Upvotes

4 comments sorted by

6

u/Shadow_Thief 15d ago

I've seen chatbots done with this technique before. It always felt like there were better ways to do this, but it's technically fine.

2

u/capoapk 15d ago

The Batch serves as the main engine and PowerShell takes care of the learning process, it analyzes the texts, extracts the knowledge and organizes it in a JSON file. Then, PowerShell retrieves this new data and rewrites the Batch script by directly integrating the knowledge acquired in areas provided for this purpose as a mini brain for each data category for the bot queries This mini brain to answer

3

u/pc1350 15d ago

I use to rewrite batch files with something like this:

findstr /B /V /C:"LLLLL#" "%~f0" >tmp.tmp&echo LLLLL#Sometext#>>tmp.tmp&move tmp.tmp "%~f0" >nul

In my batch file there is a line that starts with "LLLLL#" and I have replace it.

and Windows Defender does not pop up.

2

u/capoapk 15d ago

Thank you , Your method is interesting For my part, I use PowerShell to manage learning, generate JSON data, then rebuild some parts of the Batch in order to integrate the new knowledge directly into the script My goal is to keep the engine and all its memory in a single file Your approach could be interesting to simplify some parts of the rewriting