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!
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.
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
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.
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.
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=