![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| batch file using sed command in msdos | rita1985 | UNIX for Dummies Questions & Answers | 1 | 01-15-2008 02:19 AM |
| su command in batch mode | Rajesh Gohad | Shell Programming and Scripting | 3 | 01-26-2007 12:54 AM |
| batch command in a shell script | ivvo | UNIX for Dummies Questions & Answers | 7 | 07-20-2005 09:06 AM |
| Using Batch command | jhansrod | Shell Programming and Scripting | 5 | 06-10-2005 12:50 PM |
| trying to read batch process but need some command help | etravels | Shell Programming and Scripting | 1 | 11-19-2003 10:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi, You can use:
read -s -p "password: " pass;echo to have the entered password stored in the variable pass. A few hints: Anyone who can edit the script can also change it to for example echo $pass, a security risk... create an encrypted passwordfile, for example with echo lakris $(echo secretpassword | md5sum ) >> .mypasswd Make sure the passwd file is only readable by the owner of the script Test the entered and encrypted $pass against what's in the file for a given user. It would be a very rudimentary password handling routine but this should get You started! /Lakris |
|
||||
|
yikes, your way over my head buddy!?!? perhaps you could give an example. how would I alter the following batch command to make it prompt me for a password to execute it.
@echo off color 70 if exist "c:\new folder\file.txt" del "c:\new folder\file.txt" ECHO hi everybody ECHO. PAUSE |
|
||||
|
Quote:
I guess youa re looking for this kind of solution... @echo off set /p password="please enter the password:" echo %password% pause color 70 if exist "c:\new folder\file.txt" del "c:\new folder\file.txt" ECHO hi everybody ECHO. PAUSE you can make the script to ask for any variable with the above..! may be you can take a look at runas command and integrate it with If command to authenticate; you should have the permissions on the password file as appropriate. --ilan |
|
||||
|
Sorry, I didnt realise this was a Windows forum, how silly of me!
I wouldn't be able to do it in cmd.exe. Maybe someone else. But I can recommend ss64.com, it has a very good description of a lot of cmd.exe commands and options. /Lakris |
![]() |
| Bookmarks |
| Tags |
| batch command password xp, shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|