Need some DOS script help please

imported_Phil

Diamond Member
Feb 10, 2001
9,837
0
0
I'm making a bootable restore DVD for my sister's PC so she can recover it at any time, but I don't want her to accidentally restore the machine :)

So, can someone help me with a small script that prompts her something like:

"Are you SURE to restore? This will wipe everthing! Y/N"

and she has to type Y to start the process, or maybe even type START to get things going.

Thanks in advance :)
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
PowerQuest DriveImage would make that trivial... put the DVD in, boot from it, click a few buttons. It's very easy to use.
 

imported_Phil

Diamond Member
Feb 10, 2001
9,837
0
0
I'm using Ghost; at the moment, the process is automated, but I don't want her to accidentally put the DVD in and restore her machine or something! (Yes, it could happen... lol)

I'd just like to insert a "pause for reflection" ;) into the script.
 

horhey

Member
Dec 23, 2003
102
0
0
I would probably do something more that a pause. I would make your sister type yes to do the reimage.
something like this.... just my 2 cents

@echo off
echo ************* DO NOT CLOSE THIS WINDOW ******************

SET ans=
SET /P ans=Do you want to recover your computer from the DVD Image:

if %ans% == yes (goto :yes) else (goto :no)

:yes
echo do restore
pause
goto :end

:no
echo Please take out the DVD and reboot
pause
goto :no

:end
 

imported_Phil

Diamond Member
Feb 10, 2001
9,837
0
0
Originally posted by: horhey
I would probably do something more that a pause. I would make your sister type yes to do the reimage.
something like this.... just my 2 cents

@echo off
echo ************* DO NOT CLOSE THIS WINDOW ******************

SET ans=
SET /P ans=Do you want to recover your computer from the DVD Image:

if %ans% == yes (goto :yes) else (goto :no)

:yes
echo do restore
pause
goto :end

:no
echo Please take out the DVD and reboot
pause
goto :no

:end

Even better, that's exactly what I was after - thanks! :)
 

horhey

Member
Dec 23, 2003
102
0
0
no problem.:beer: i would probably add another if statement for the yes section now that i think about it

:yes
SET /P ans2=Are you sure??:
if %ans2% == yes (goto :yes2) else (goto :no)
goto :yes2

:yes2
echo do restore
pause
goto :end
 

OZEE

Senior member
Feb 23, 2001
985
0
0
Then "are you REALLY sure?" and "are you sure you're REALLY sure?" ad nauseum... hehe
 

horhey

Member
Dec 23, 2003
102
0
0
Originally posted by: OZEE
Then "are you REALLY sure?" and "are you sure you're REALLY sure?" ad nauseum... hehe

well when it comes to reimaging a computer with a end user doing the imaging i guess there can never be to many checks. hehe
 

horhey

Member
Dec 23, 2003
102
0
0
I think that was what DopeFiend wanted. A batch file that would not let the end user continue and reimage the computer unless they typed in yes. Unless I am mistaken.
 

FreshPrince

Diamond Member
Dec 6, 2001
8,361
1
0
Originally posted by: horhey
I think that was what DopeFiend wanted. A batch file that would not let the end user continue and reimage the computer unless they typed in yes. Unless I am mistaken.

by having the:

:no
goto :no

it puts the "hit any key to continue" in a loop...by changing it to:

:no
goto :end

it quits the batchfile and puts you in a command prompt without running the ghost script.

:)