China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 02:19
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Regarding the password input hiding in batch processing, my teacher's explanation View 10,794 Replies 49
Floor 46 Posted 2008-07-26 17:28 ·  中国 上海 电信
新手上路
Credits 2
Posts 1
Joined 2008-07-26 12:50
17-year member
UID 122138
Gender Male
Status Offline
The `for /f "tokens=*" %%i in ('in.com') do set password=%%i`

This is a Windows batch command. The `for /f` loop is used to iterate over the output of the command `in.com`. The `tokens=*` option means that it will capture the entire line of output from `in.com`, and then assign that captured value to the variable `password`. The part `in ('in.com')` specifies that the input for the `for /f` loop comes from the output of the `in.com` command.
Floor 47 Posted 2008-10-19 17:28 ·  中国 江西 赣州 电信
新手上路
Credits 13
Posts 15
Joined 2008-10-19 15:37
17-year member
UID 128763
Gender Male
Status Offline
Can't understand!!!
Floor 48 Posted 2008-10-21 08:30 ·  中国 黑龙江 大兴安岭地区 联通
新手上路
Credits 2
Posts 2
Joined 2008-09-04 13:12
17-year member
UID 124768
Gender Male
Status Offline
Can't understand. I don't know assembly language.
Floor 49 Posted 2008-12-14 16:12 ·  中国 湖北 武汉 电信
新手上路
Credits 15
Posts 8
Joined 2008-01-14 21:36
18-year member
UID 108622
Gender Male
Status Offline
Not quite understand~~~
Floor 50 Posted 2008-12-22 22:48 ·  中国 广东 深圳 福田区 电信
新手上路
Credits 11
Posts 7
Joined 2008-11-23 13:00
17-year member
UID 131905
Gender Male
Status Offline
Can batch processing read an encrypted password file? Enter a password in batch processing and then encrypt it. Later, execute it to decrypt it. I have compiled a folder encryption program code as follows. Please correct it. Save the following code as "Folder Encryption.bat". Enter "13242905978" and temporarily use it as the sn. The initial password is set by yourself.

@echo off
title Hidden Folder Expert
color 0f
set Errorlevel=
Cd.>"%~dp0a.txt"
If "%Errorlevel%"=="1" goto hderr
If "%Errorlevel%"=="0" goto sta
:sta
del "%~dp0a.txt" /f /s /q >nul 2>nul
if not exist %windir%\wxbhidefold.dll goto snNZ
if exist %windir%\wxbhidefold.dll goto mimanz
:mimanz
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Warning!
ECHO.
echo !For the safety of this file, please set your personal password!
echo.
echo To prevent others from using this software! Resulting in adverse consequences.
ECHO.
set mima=
set /p mima=Please enter your personal password of more than 8 digits for verification:
for /f %%d in (%windir%\wxbhidefold.dll) do set m=%%d
if "%m%"=="%mima%" goto bigen
if not "%m%"=="%mima%" goto MIMACOWU
if errorlevel==1 goto MIMACOWU
:snNZ
cls
color 1f
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Warning!
ECHO.
echo !For the safety of this file, please enter the sn code to verify your permission!
echo.
echo To prevent others from using this software! Resulting in adverse consequences.
ECHO.
set sn=13242905978
set /p snnz=Please enter the sn code to verify your permission:
if /i "%snnz%"=="" goto nokong
if /i "%snnz%"=="%sn%" goto scyx
if not "%snnz%"=="%sn%" goto sncowu1

:scyx
cls
color 0f
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Warning!
ECHO.
echo !For the safety of this file, please set your personal password!
echo.
echo To prevent others from using this software! Resulting in adverse consequences.
ECHO.
set mima=
set /p mima=Please set your personal password, preferably more than 8 digits:
if /i "%mima%"=="" goto nokong
if exist %windir%\wxbhidefold.dll ATTRIB.exe -A -R -H -S %windir%\wxbhidefold.dll >nul 2>nul
echo %mima% > %windir%\wxbhidefold.dll

type %windir%\wxbhidefold.dll|find "Closed State"
if "%errorlevel%"=="0" goto nokong

cls
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
color 9f
echo.
echo Please remember your personal password! Your current password is:
echo.
echo [ %mima% ]
echo.
echo Remember it and press any key to continue......
echo.
pause>nul
goto bigen



:nokong
echo %m%>%windir%\wxbhidefold.dll
cls
color 4f
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo Your set password cannot be empty, which is unsafe. Please re-enter your personal security password
echo.
echo.
pause>nul
goto scyx
:MIMACOWU
color 4f
cls
echo.
echo X!X!X! Your password is incorrect !X!X!X
echo ---------------------------
echo.
echo Note the case! Press any key to enter the second password input?
echo.
PAUSE>NUL
GOTO mima2

:mima2
CLS
COLOR 0F
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Second Warning!
ECHO.
echo !For the safety of the file, please set your personal password!
echo.
echo To prevent others from using this software! Resulting in adverse consequences.
ECHO.
set mima=
set /p mima=Please enter your personal password of more than 8 digits for verification:
for /f %%d in (%windir%\wxbhidefold.dll) do set m=%%d
if "%m%"=="%mima%" goto bigen
if not "%m%"=="%mima%" goto mima3
if errorlevel==1 goto mima3

:mima3
color 4f
cls
echo.
echo X!X!X! Your password is incorrect !X!X!X
echo ---------------------------
echo.
echo Note the case! Press any key to enter the third password input?
ECHO.
PAUSE>NUL 2>NUL
CLS
COLOR 0F
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Final Warning!
ECHO.
echo !For the safety of the file, please set your personal password!
echo.
echo To prevent others from using this software! Resulting in adverse consequences.
ECHO.
set mima=
set /p mima=Please enter your personal password of more than 8 digits for verification:
for /f %%d in (%windir%\wxbhidefold.dll) do set m=%%d
if "%m%"=="%mima%" goto bigen
if not "%m%"=="%mima%" goto mima4
if errorlevel==1 goto mima4

:mima4
color 4f
cls
echo.
echo X!X!X! Your password is incorrect !X!X!X
echo ---------------------------
echo.
echo It seems you are not the real owner. Press any key to exit!
echo.
PAUSE>NUL
GOTO EXIT

:sncowu1
CLS
COLOR 4F
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !First Warning!
ECHO.
ECHO.
echo !For the safety of this file, please enter the sn code to verify your permission!
echo.
echo You have made a mistake once. To prevent others from using this software! Resulting in adverse consequences.
ECHO.
pause
ECHO.
set /p snnz=Please enter the sn code to verify your permission:
if /i "%snnz%"=="" goto nokong
if /i "%snnz%"=="%sn%" goto scyx
if not exist "%snnz%"=="%sn%" goto sncowu2

:sncowu2
CLS
COLOR 4F
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Second Warning!
ECHO.
ECHO.
echo !For the safety of this file, please enter the sn code to verify your permission!
echo.
echo You have made two mistakes. To prevent others from using this software! Resulting in adverse consequences.
ECHO.
pause
ECHO.
set /p snnz=Please enter the sn code to verify your permission correctly:
if /i "%snnz%"=="" goto nokong
if /i "%snnz%"=="%sn%" goto scyx
if not "%snnz%"=="%sn%" goto sncowu3

:sncowu3
CLS
COLOR 4F
ECHO.
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo !Third Warning!
ECHO.
ECHO.
echo !For the safety of this file, please enter the sn code to verify your permission!
echo.
echo You have made three mistakes. To prevent others from using this software! Resulting in adverse consequences.
ECHO.
pause
ECHO.
set /p snnz=Please enter the sn code to verify your permission for the last time:
if /i "%snnz%"=="" goto nokong
if /i "%snnz%"=="%sn%" goto scyx
if not "%snnz%"=="%sn%" goto mima4

:bigen

set fd=Recycled\UDrives.{21EC2020-3AEA-1069-A2DD-08002B30309D}\Recycled
set pf=c: d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:
set pfZ=Z: Y: X: W: V: U: T: S: R: Q: P: O: N: M: L: K: J: I: H: G: F: E: D:
if not exist "%~dp0%fd%" (
md "%~dp0%fd%" >nul 2>nul
md "%~dp0%fd%\system Recycled..\"

attrib +a +r +h +s "%~dp0Recycled" /s /d>nul 2>nul
attrib /s /d +a +r +h +s "%~dp0%fd%"
attrib /s /d +a +r +h +s "%~dp0Recycled\UDrives.{21EC2020-3AEA-1069-A2DD-08002B30309D}\
)

echo Instructions:>"%~dp0%fd%\system Recycled..\readme.txt"
echo.>>"%~dp0%fd%\system Recycled..\readme.txt"
echo Here is the safe haven for your files>>"%~dp0%fd%\system Recycled..\readme.txt"
echo.>>"%~dp0%fd%\system Recycled..\readme.txt"
echo Click the back and up buttons under the Windows window, and then perform file copy and move operations,>>"%~dp0%fd%\system Recycled..\readme.txt"
echo.>>"%~dp0%fd%\system Recycled..\readme.txt"
echo To hide the file, no one will know. Finally, press Enter to close the cmd window>>"%~dp0%fd%\system Recycled..\readme.txt"
echo.>>"%~dp0%fd%\system Recycled..\readme.txt"
echo. >>"%~dp0%fd%\system Recycled..\readme.txt"
echo This program is made by Wan Xibing, technical support:13242905978>>"%~dp0%fd%\system Recycled..\readme.txt"

for /f %%a in ("%~dp0%fd%\system~1\Access Records.txt") do type %%a|find "Time" /c >>"%temp%\cishu.txt"

for /f "tokens=* usebackq" %%a in ("%temp%\cishu.txt") do set /a cs=%%a+1& del /f /s /q "%temp%\cishu.txt" >nul
echo The %cs%th time: The user %username% with the computer name %USERDOMAIN% has visited. The time is: %date% %time% >>"%~dp0%fd%\system Recycled..\Access Records.txt"

echo [.ShellClassInfo]>"%~dp0%fd%\desktop.ini"
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E}>>"%~dp0%fd%\desktop.ini"
echo [.ShellClassInfo]>"%~dp0Recycled\desktop.ini"
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E}>>"%~dp0Recycled\desktop.ini"
echo Please wait...
for %%d in (%pf%) do if not exist %%d subst.exe>nul %%d "%~dp0%fd%\system~1" && cd/d %%d && set p=%%d&&goto one
ATTRIB.exe +A +R +H +S %windir%\wxbhidefold.dll >nul 2>nul
:err
echo err =msgbox("An error occurred! All available drive letters have been used up! No available drive letters left!",64,"Prompt!")>%temp%\err.vbs
start /wait %temp%\err.vbs
exit
::taskkill /f /im cmd.exe

:one
cls
echo.
echo Instructions:
echo Wait until you finish processing the file and press Enter to close this window. The program will automatically end
echo.
echo Click the back and up buttons under the Windows window, and then perform file copy and move operations,
echo.
echo To hide the file, no one will know. Finally, press Enter to close the cmd window.
echo.
echo After processing, activate this window with the mouse and press any key to close this program!
::ping 192.168.0.1 -n 4 >nul 2>nul
color 2a
explorer "%p%"
::start/max /wait %p%\System Folder MSDOS Function Invalid.%~dp0
color 2a
echo.
pause>nul
for %%d in (%pfZ%) do subst.exe>nul 2>nul /d %%d
subst.exe /d %p%
dir "%~dp0Recycled"
if "%errorlevel%"=="1" attrib.com +a +r +h +s "%~dp0Recycled" /s /d
goto exit

:hderr
color c0
echo.
echo Welcome to Wan Xibing's Special Folder Creation, Viewing and Deletion Program
echo ========================================
echo.
echo An error occurred! Is the location where this program is currently located in a writable state
echo.
echo Copy this program to a writable device such as a hard drive or USB mobile device to run it
echo.
echo Press any key to exit
pause


:EXIT
::del %0 /f /s /q>nul
::taskkill /f /im cmd.exe
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
keen +2 2009-02-02 11:37
Forum Jump: