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-08 23:21
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] ********Escape Encryption and Unescape Decryption******** View 1,370 Replies 6
Original Poster Posted 2007-11-03 14:44 ·  中国 北京 鹏博士BGP
银牌会员
★★★
Credits 2,098
Posts 566
Joined 2007-09-11 07:27
18-year member
UID 97070
Gender Male
Status Offline
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
lxmxn +12 2007-11-03 23:32
junchen2 +4 2007-11-04 23:55
Floor 2 Posted 2007-11-05 09:28 ·  中国 北京 海淀区 联通
银牌会员
★★★
Credits 1,287
Posts 634
Joined 2007-05-02 15:06
19-year member
UID 87277
Gender Male
From cmd.exe
Status Offline
Good stuff. Still learning.
Floor 3 Posted 2007-11-06 19:24 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
I think writing it as <"%~f0" more +130 is not good. If someone deletes some blank lines above or adds some comments of their own, it won't work anymore. I suggest using call goto.
Floor 4 Posted 2007-11-07 02:48 ·  中国 浙江 杭州 教育网
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
Originally posted by vkill at 2007-11-6 07:24 PM:
I think writing it as <"%~f0" more +130 is not good. If someone deletes some blank lines above or adds some comments of their own, it won't work anymore. I suggest using call goto.


I've read several posts by the OP;
this thing was used in many places;

problems really can easily come up; what vkill said makes a lot of sense
Floor 5 Posted 2007-12-05 17:39 ·  中国 北京 电信
银牌会员
★★★
Credits 2,098
Posts 566
Joined 2007-09-11 07:27
18-year member
UID 97070
Gender Male
Status Offline
To receive pointers from experts bjsh and vkii, I am really flattered.
But the advantage of this line can't be denied either — it can attach some script code unchanged to the end of the batch file, making the batch code more readable.
Floor 6 Posted 2007-12-06 20:09 ·  中国 甘肃 定西 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Originally posted by s11ss at 2007-12-5 17:39:
To receive pointers from experts bjsh and vkii, I am really flattered.
But the advantage of this line can't be denied either — it can attach some script code unchanged to the end of the batch file, making the batch code more readable.

What you said at the end can be done like this



@echo off&endlocal&setlocal ENABLEDELAYEDEXPANSION

for /f "tokens=1 delims=:" %%? in ('findstr /N "=Hiddenpass.cmd_s=" "%oneself%"') do (more +%%? %oneself%>"%temp%\a")
for /f "tokens=1 delims=:" %%? in ('findstr /N "=Hiddenpass.cmd_e=" "%oneself%"') do (set/a "a=%%?-1" & more +!a! %oneself%>"%temp%\b")
findstr /V /B /E /G:"%temp%\b" "%temp%\a">"%temp%\pass.cmd"

exit

=Hiddenpass.cmd_s=
@echo off
chcp 437>nul&graftabl 936>nul
echo hP1X500Pf3/f1/5++u5x>in.com
echo (Note: when entering the password, it is not displayed in plain text)
set /p password=Please enter the password for mail:%~1:<nul
for /f "tokens=*" %%i in ('in.com') do set password=%%i
del in.com
echo.
>%temp%\pass set password
exit
=Hiddenpass.cmd_e=

Floor 7 Posted 2007-12-06 20:29 ·  中国 北京 联通
银牌会员
★★★
Credits 1,287
Posts 634
Joined 2007-05-02 15:06
19-year member
UID 87277
Gender Male
From cmd.exe
Status Offline
Actually, nobody said all the code must be packed into one BAT.

So. splitting it up is fine too .
Forum Jump: