Is there anyway to popup a message with a batch script where the user has to click OK for the batch file to run?
I current have it so that it pops up a message and the user has to click OK and then Enter in the command prompt but this is a problem because the command prompt gets hidden behind another active window. Any help is appreciated.
============================================================
msg %username% Click OK and then Enter to start backup.
pause
============================================================
Also, if you can tell me if the following script can be shortened or rewritten so it is closer to scripting standards, that woudl be great.
==========================================================
msg %username% Click OK and then Enter to start backing up your Outlook Email
pause
if not exist "c:\Documents and Settings\%username%\My Documents\Outlook Backup\null" mkdir "c:\Documents and Settings\%
username%\My Documents\Outlook Backup"
if not exist "c:\Documents and Settings\%username%\My Documents\Outlook Backup\Archive\null" mkdir "c:\Documents and
Settings\%username%\My Documents\Outlook Backup\Archive"
xcopy "c:\Documents and Settings\%username%\My Documents\Outlook Backup\Current" "c:\Documents and Settings\%username%\My
Documents\Outlook Backup\Archive" /d/e/c/q/h/r/y
rmdir /S/Q "C:\Documents and Settings\%username%\My Documents\Outlook Backup\Current"
if not exist "c:\Documents and Settings\%username%\My Documents\Outlook Backup\Current\null" mkdir "c:\Documents and
Settings\%username%\My Documents\Outlook Backup\Current"
if "%TODAYDATE%"=="" set TODAYDATE=%date:~4,2%-%date:~7,2%-%date:~10,4%
if "%date:~2,1%"=="/" set TODAYDATE=%date:~0,2%-%date:~3,2%-%date:~6,4%
mkdir "c:\Documents and Settings\%username%\My Documents\Outlook Backup\Current\%todaydate%"
taskkill /IM outlook.exe
ping -n 60 127.0.0.1>nul
xcopy "c:\documents and settings\%username%\local settings\application data\microsoft\outlook" "c:\Documents and Settings\%
username%\My Documents\Outlook Backup\Current\%todaydate%" /d/e/c/q/h/r/y
for /f %%i in ('date /t') do (
if %%i==Fri if exist "c:\Documents and Settings\%username%\My Documents\Outlook Backup\Current\**-**-****" rmdir /S/Q
"C:\Documents and Settings\%username%\My Documents\Outlook Backup\Archive\"
)
msg %username% The backup has completed. Click OK to close.
============================================================