Computing.Net > Forums > Programming > Batch ask for name?

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 ask for name?

Reply to Message Icon

Name: Mathieu Gendreau
Date: July 30, 2005 at 20:03:01 Pacific
OS: Windows 98SE
CPU/Ram: not needed
Comment:

Hello everybody,
I need a batch script that will ask for the username, then store it in the %username% variable. A exemple would look like, the batch asking for your name and then greeting you. I hope to get a answer soon, thank you.

Sincerly yours,
Mathieu Gendreau.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: July 31, 2005 at 02:40:09 Pacific
Reply:

::== getname.bat
@echo off

:main
if %1'==' goto :syntax
set username=%1
echo hello %username%
goto :end

:syntax
cls
echo please re-run %0.bat followed by your name; like this: %0 myname

:end
::==

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: Mathieu Gendreau
Date: July 31, 2005 at 10:00:53 Pacific
Reply:

Hello Mechanix2Go,
I greatly appreciate your help, but the script I am looking for, prompt the user to type his name and then stores it has a variable (%username%).Thank you.

Sincerly yours,
Mathieu Gendreau.


0

Response Number 3
Name: dtech10
Date: July 31, 2005 at 14:07:00 Pacific
Reply:

Hi Mathieu
I wrote Input.com a while ago.
It may be what youre looking for.
http://www.computing.net/programming/wwwboard/forum/12162.html


0

Response Number 4
Name: Mechanix2Go
Date: July 31, 2005 at 22:47:17 Pacific
Reply:

Hi dtech10,

Yup, that'll do it.

M2


If at first you don't succeed, you're about average.


0

Response Number 5
Name: Mechanix2Go
Date: July 31, 2005 at 23:12:51 Pacific
Reply:

oops,

The set /p won't fly in w98. Nor any MSDOS.

M2


If at first you don't succeed, you're about average.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






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 ask for name?

Batch procedure for adding in *.txt www.computing.net/answers/programming/batch-procedure-for-adding-in-txt/16209.html

Batch Script for setting up www.computing.net/answers/programming/batch-script-for-setting-up/12506.html

Ask for name on open & update field www.computing.net/answers/programming/ask-for-name-on-open-update-field/17782.html