I found a simple batch script for restarting explorer in Windows.
@ECHO OFF
echo.
echo Step1: Closing Explorer . . .
echo.
TASKKILL /F /IM explorer.exe
echo.
echo.
echo Step2: Launching Explorer . . .
start explorer.exe
echo.
echo Success: Explorer started.
echo.
echo.
PAUSE
But I would like it to start with a simple, default Windows popup window, something like this:
Do you really want to restart the explorer?
|Yes| |NO|
Yes = *.bat file start
No = termination
What will be the easiest way to achieve this?
EDIT:
Why I want the warning message popup? Because I've pinned the script to the taskbar and I prefer the default window popup before launching the script than answering questions in cmd. It's just esthetic's. Can anyone help?
SOLUTION
Set WshShell = CreateObject("WScript.Shell")
A = WshShell.Popup("Do you want to restart the Explorer?", 60, "Windows Explorer Restart Script", 4)
If A = 6 then
Wshshell.Run "C:\path\to\your\Batch_File.bat", 0
WScript.Quit 2
ElseIf A = 7 then
WScript.Quit 1
End If
Result: How it looks like