|
|
|
Batch file help
|
Original Message
|
Name: dforster
Date: February 13, 2005 at 19:35:24 Pacific
Subject: Batch file helpOS: WinXP ProCPU/Ram: P4 3GHz |
Comment: Hi, I have created a batch file that runs full screen and displays a lock screen. It is used at school because we cannot lock the computers. To unlock it, it requires a code. The problem is that when the code is entered it is displayed on the screen so other people can see it. My question is: is there a way to hide the input from a set /p command? This is what I have so far: ************************************* Lock Computer II.bat ----- @ECHO OFF :header title Lock Computer II for %username% cls goto start :start echo This computer is in use and has been locked. echo. echo Only %username% can unlock this computer. echo. set unlockcode= set /p unlockcode=Enter the Unlock Code to unlock this computer. if '%unlockcode%'=='1234567890' goto unlock if not '%unlockcode%'=='1234567890' goto middle :middle cls echo The Unlock Code you entered is incorrect. echo. echo Please enter the code again. echo. echo If the problem persists, please contact your distributor. echo. goto start :unlock goto end :end exit --- ********************************** Thankyou for your help, David F
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: dtech10
Date: February 14, 2005 at 07:02:18 Pacific
Subject: Batch file help |
Reply: (edit)Hi David For now until I or someone else can think of something better and since you are using WinXP. You could use the "color" command to make your input less visible, for the syntax just type "color /?" at the prompt. XP won't let you set the background and foreground to the same color, which in your case is a pity. Hope this helps
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: dtech10
Date: February 14, 2005 at 15:01:43 Pacific
Subject: Batch file help |
Reply: (edit)Hi Robert A better solution. Type the text below into Notepad and save as Input.txt. The blank line is important and is just a carriage return. Then enter at prompt "debug < input.txt". This creates the Input.com file. Then use the batch file below as a test. ------------ A MOV AH,08 INT 21 MOV DL,AL MOV AH,02 INT 21 CMP DL,0D JNZ 0100 MOV AH,4C INT 21 RCX 18 NINPUT.COM W Q ------------- echo off set pw=1234567890 echo Enter Password input > pw.txt set /p password=< pw.txt if %password%==%pw% ( echo Password OK )else ( echo Access Denied ) set pw= set password= del pw.txt
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: dforster
Date: February 15, 2005 at 02:20:23 Pacific
Subject: Batch file help |
Reply: (edit)Thanks for your replies. When I type in "debug < input.txt" (without quotes) into the command prompt, I get this response: -A 0B20:0100 MOV AH,08 0B20:0102 INT 21 OB20:0104 MOV DL,AL 0B20:0106 MOV AH,02 0B20:0108 INT 21 0B20:010A CMP DL,0D 0B20:010D JNZ 0100 0B20:010F MOV AH,4C 0B20:0111 INT 21 0B20:0113 RCX ^ Error 0B20:0113 18 ^ Error 0B20:0113 NINPUT.COM ^ Error 0B20:0113 W ^ Error 0B20:0113 Q and CMD.exe freezes. There is no input.com file in the same folder as the input.txt file. Any ideas? Thanks, David F
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Mechanix2Go
Date: February 15, 2005 at 03:41:32 Pacific
Subject: Batch file help |
Reply: (edit)Hi David, I make it a practice to put at least one ENTER after the Q One will suffice. But without it, debug hangs. M2
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: Mechanix2Go
Date: February 16, 2005 at 14:54:07 Pacific
Subject: Batch file help |
Reply: (edit)d10, I hope. This is pretty cool stuff. I'm always reluctant to post debug scripts. It's a little like handing a butcher knife to a child. Best regards M2
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: dtech10
Date: February 17, 2005 at 13:06:32 Pacific
Subject: Batch file help |
Reply: (edit)Hi Mechanix Thanks for the compliment. Youre right about danger in not doing things they do'nt really understand, but I should hope that others may benifit from them as input is offen needed in batch files and would be more usefull to the people who don't have those extra WinXP/2000 batch commands.
Report Offensive Follow Up For Removal
|
Use following form to reply to current message:
|
|

|