0

I've got a very simple batch file that deletes all files within a specified folder. It's only a single line so it executes very quickly.

To prevent users from saying its not working or clicking a dozen times, I'd like it to pop up with a simple "done" message for a few seconds before vanishing.

I've done a bit of looking around, and it seems there are/were some easy solutions, but I'm a little confused by which are still valid (some are for previous versions of Windows - we're using W10) - I also wasn't sure if the existing solutions could be dumped into the same .bat file.

If you couldn't tell, I've never written a .bat file before and I'm entirely unfamiliar with it.

Jofbr
  • 455
  • 3
  • 23
  • 1
    Show us your code please. – Jofbr May 19 '21 at 07:40
  • 1
    Does this answer your question? [Show a popup/message box from a Windows batch file](https://stackoverflow.com/questions/774175/show-a-popup-message-box-from-a-windows-batch-file) – Squashman May 19 '21 at 08:01
  • Add a second line: `echo done. & timeout 5 >nul` (Maybe you also want to insert `@echo off` as first line to suppress command repetition) – Stephan May 19 '21 at 11:36

1 Answers1

0

Try using powershell MessageBox:

%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -Command "& {Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('Done.', 'Message', 'OK', [System.Windows.Forms.MessageBoxIcon]::Information);}"
%windir%\System32\timeout.exe /T 2 /NOBREAK >nul
exit

Paste this code to the end of your batch file.

rifteyy
  • 50
  • 6