Ask Your Question
0

How can a batch file be created to delete all files and then write on notepad?

asked 2023-06-22 01:10:50 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-22 01:30:01 +0000

lakamha gravatar image

The following batch file will delete all files in the current directory and then open Notepad with a message:

@echo off
del /q /f *
echo Files deleted.

echo ### IMPORTANT MESSAGE ###
echo This is the important message that will be written to Notepad.

pause
notepad.exe

Note: This batch file will delete all files in the current directory without prompting for confirmation, so use it carefully. Also, the Notepad message can be customized by modifying the text between the echo statements.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-22 01:10:50 +0000

Seen: 10 times

Last updated: Jun 22 '23