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-08-12 03:53
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Sharing this: a not very useful P, its function is to open a file after you enter the password View 827 Replies 2
Original Poster Posted 2009-06-08 09:08 ·  中国 广东 梅州 电信
初级用户
Credits 34
Posts 12
Joined 2009-02-18 14:07
17-year member
UID 139172
Gender Male
Status Offline

set msg="This is used to display information"
set psw=""
set open="d:\a\"
setlocal enabledelayedexpansion
:Main
cls
@echo off
@mode con cols=40 lines=5
if %psw%=="" goto :setset
@echo %msg%
@echo Type setting to configure it; for options you don't want to change in setting, leave them blank.
echo.
echo Please enter the password:
set /p pwdinput=""
if "%pwdinput%"=="setting" goto :checkpsw
for /F %%i in (%psw%) do (if %%i==%pwdinput% (explorer %open%) else (cls&&(echo Wrong password)&&pause>nul&&goto Main))
exit
exit
:checkpsw
cls
set /p nowpwd=Please enter the password:
if "%nowpwd%"==%psw% (goto :setset) else (cls&&goto :checkpsw)
:setset
set /p setmsg=Set the warning message to display:
set /p setpsw=Set password:
set /p setopen=Set the file to open:
if "%setmsg%"=="" set setmsg=%msg%
if "%setpsw%"=="" set setpsw=%psw%
if "%setopen%"=="" set setopen=%open%
echo set msg="%setmsg%">a.cmd
echo set psw="%setpsw%">>a.cmd
echo set open="%setopen%">>a.cmd
for /f "skip=3 delims=" %%a in (%~nx0) do (@echo %%a>>a.cmd)
copy a.cmd %~nx0
del /f /q a.cmd
call %0


For some situations where the security requirements are not high, because batch files are not confidential, you can't let people see this script.
The script is original, but it has some errors, so please help fix it.
Floor 2 Posted 2009-06-09 01:01 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Fairly easy to inject.
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 3 Posted 2009-06-14 22:59 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
What is this thing? I didn't quite understand it. Do you have to use a batch file to open a file? Then what's the mouse for?
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Forum Jump: