Go Back   Computer Forums > General Computing > Software and Operating Systems
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-24-2011, 11:28 PM   #1
BSOD
 
Join Date: Aug 2011
Posts: 45
Default More .bat Help please

I also need help with this bath file

How do i get a user to enter the password "DDAF" to start the "chkdsk" command?
and if the user enters a wrong password I want them to be dispalyed with a Wrong Password Message and "pause" then taken to :start


@echo off
:start
title GDAY!
color 3A
set /p name=HELLO WHATS YOUR VIEW ON THE WORLD TODAY?
echo %name%
echo The Local Time (As set in your BIOS)
time /t
date /t
pause
echo Please tell me what you think of this basic system checking tool.
pause
cls
echo Select Your Tool
choice /c:1234567 /m "1=Shutdown Computer 2=Convert FAT Drive to NTFS 3=Check Your Bootstrap Loader (Boot Sector) 4=Tasklist 5=Test Copy 6=Start Over 7=End Job"
if errorlevlel 7 goto end
if errorlevel 6 goto six
if errorlevel 5 goto five
if errorlevel 4 goto four
if errorlevel 3 goto three
if errorlevel 2 goto two
if errorlevel 1 goto one
ne
echo Please comfirm shutdown (Press ENTER)
pause
goto shutdown
:shutdown
cls
set /p sec=Enter The Amount Of Seconds Berfore Shutdown
shutdown -s -f -t %sec% -c Seya
echo Shutdown Initiated at %time%
set /p stop=To cancel shut down type STOP
if %stop%==stop shutdown -a
if %stop%==stop goto start
:two
convert c:
pause
cls
goto start
:three

(NOT PART OF BATCH FILE, ENTERED ON FORUM)

set /p DDAF=Enter Password (Password Is Not Masked)
if %DDAF% goto threestart


:threestart
set /p drive=Enter Drive Letter (Don't Forget The :!!)
echo You Selected Drive %drive%
chkntfs %drive%
pause
cls
goto start
:four
tasklist
pause
cls
goto start
:five
copy c:\windows\system32\hal.dll c:\
pause
cls
goto start
:six
goto start
:end
__________________

crashoveride is offline   Reply With Quote
Old 08-25-2011, 12:02 AM   #2
Fully Optimized
 
strollin's Avatar
 
Join Date: Mar 2011
Location: USA
Posts: 1,936
Default Re: More .bat Help please

How about something like this:

@echo off
:start
cls
set /p PW=Enter Password (Password Is Not Masked)
IF %PW%==mypassword goto threestart
echo "Wrong password!"
pause
goto start
:threestart
echo "Right password!"
pause
strollin is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0