Computing.Net > Forums > Programming > Batch script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch script

Reply to Message Icon

Name: kil
Date: June 29, 2006 at 15:54:45 Pacific
OS: Windows XP
CPU/Ram: 3.2Ghz
Product: Dell
Comment:

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.
============================================================



Sponsored Link
Ads by Google

Response Number 1
Name: CWoodward
Date: June 30, 2006 at 00:32:10 Pacific
Reply:

Remove the PAUSE and add the flag /W to the MSG command.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch script

batch script to parse filenames www.computing.net/answers/programming/batch-script-to-parse-filenames/15286.html

Batch Script Help Needed www.computing.net/answers/programming/batch-script-help-needed/14475.html

batch script www.computing.net/answers/programming/batch-script/14086.html