Computing.Net > Forums > Programming > Batch Are you sure?

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 Are you sure?

Reply to Message Icon

Name: chat1410
Date: July 13, 2007 at 20:50:55 Pacific
OS: Windows XP Home
CPU/Ram: P$ 3/06 GHz/GB
Product: Intel
Comment:

I need a set of commands that asks "Are you sure" and if yes, runs a DOS command and if no exits. I'd like the "Are you sure?" to default "n". My test, non-working program is. @echo off
echo Are you sure? (y/n)
set /p shutdown=(n)
if %shutdown==y
shutdown -s -f -m \\computername




Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 14, 2007 at 03:37:35 Pacific
Reply:

Replace your IF statement with this:
if "%shutdown%"=="y" shutdown -s -f -m \\computername


0

Response Number 2
Name: chat1410
Date: July 14, 2007 at 22:00:23 Pacific
Reply:

Thank you, it worked.


0

Sponsored Link
Ads by Google
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 Are you sure?

delete a registry key with batch? www.computing.net/answers/programming/delete-a-registry-key-with-batch/8218.html

Batch to edit Batch www.computing.net/answers/programming/batch-to-edit-batch/16925.html

Need batch that does 5 things www.computing.net/answers/programming/need-batch-that-does-5-things/18224.html