中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-10 16:55
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » A new method to randomly obtain file names
Printable Version  3,067 / 5
Floor1 zh159 Posted 2006-12-09 13:46
金牌会员 Posts 1,467 Credits 3,687
Four months ago, we discussed the method of randomly obtaining file names together and found that the best code is:
A question about randomly obtaining file names
The code from moderator Wunaihe on floor 24:

And the codes modified by everyone later

Tonight, inspired by the "set ." special usage (sorting) from redtek on floor 15 in:

Floor2 redtek Posted 2006-12-09 22:38
金牌会员 Posts 1,147 Credits 2,902
Brother, your code is concise and wonderful. I appreciate it.
Floor3 zh159 Posted 2006-12-09 22:46
金牌会员 Posts 1,467 Credits 3,687
Got up in the morning and thought of the application of call (without using delay variables ):
Floor4 redtek Posted 2006-12-09 22:50
金牌会员 Posts 1,147 Credits 2,902
Haha... This call was played beautifully~ :)
Floor5 HUNRYBECKY Posted 2006-12-10 00:45
银牌会员 Posts 442 Credits 1,179
Strong, the code above can be slightly modified to scan for specified (type) files on the hard drive and perform related operations. For example, some time ago when the Viking virus was encountered, a batch file could be created and placed in the C drive:

@echo off
for /f "delims=" %%i in ('dir /a/b/s desktop.ini') do call set $%%random%%$%%i=$
for /f "tokens=1,2* delims=$=" %%i in ('set $') do echo %%j >>c:\deleted_virus_files.txt
pause

This will find all _desktop.ini files and perform the deletion operation.
Floor6 lxmxn Posted 2006-12-10 01:54
版主 Posts 4,938 Credits 11,386
Originally posted by HUNRYBECKY at 2006-12-10 00:45:
Powerful, the code above can be slightly modified to scan for specified (type) files on the hard drive and perform related operations. For example, some time ago, the Viking virus was infected. You can create a batch file and place it in the C drive:
...


  The main file of the Viking virus is _desktop.ini, and if you do this, all desktop.ini files under the C drive will be deleted, which may affect some system properties.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023