Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 03-14-2009, 10:54 PM   #1
Beta Member
 
burn2destroy's Avatar
 
Join Date: Mar 2009
Posts: 4
Default Command Prompt Help

Well, I think I got this script right for my OS, its to make a new user or login.

Code:
@echo off
:start
cls
echo Have you got an account? (Y/N)
set /p yn=
IF %yn% == N GOTO 1
IF %yn% == n GOTO 1
IF %yn% == Y GOTO 2
IF %yn% == y GOTO 2

:1
cls
echo Please type your new account name.

set /p username=
md %username%
cls
echo loading
ping localhose -n 2 > nul
cls
echo loading.
ping localhose -n 2 > nul
cls
echo loading..
ping localhose -n 2 > nul
cls
echo loading…
ping localhose -n 2 > nul
cls
echo Enjoy!
cls
PAUSE > nul
goto start
exit

:2
cls
set /p login=Username:
if not exist %login% goto start
:logged in
cls
echo You are logged in.
PAUSE > nul
Does it look right?
__________________

burn2destroy is offline   Reply With Quote
Old 03-15-2009, 01:34 AM   #2
Fully Optimized
 
Š88's Avatar
 
Join Date: May 2005
Posts: 4,775
Send a message via MSN to Š88
Default Re: Command Prompt Help

it's been ages since i've done any shell scripting so i can't comment on whether it's correct or not but one thing I noticed immediately is that there is no handle for improper user inputs
__________________
Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine Lösung!
Š88 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 10:55 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