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-23 04:33
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Unresolved] Batch non-empty judgment access and deletion of slightly deformed directories View 14,734 Replies 67
Floor 16 Posted 2008-03-02 00:59 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Originally posted by slore at 2008-3-2 12:05 AM:
We see that the original folder displayed is missing a dot.
......
It should be original hehe. At least I didn't copy it from other places.


What does it mean?
You mean I'm copying, right,

In many of the posts I posted before, as long as it was something I thought of myself, I wanted to mark it as original, but as I progressed in my studies, when I looked back at those previous posts, I couldn't help but laugh at myself, because I marked something as original with overly simple code, then original posts would be everywhere. It would also make the posts in the alliance have little technical content.

There are only about 70 commands in cmd. The thinking space is limited. As long as it's introduced in the cmd built-in help, saying it's original will attract many sneers. Unless there is a subversive thinking or algorithm included in it.

If it's a good post, it will naturally be copied. (Everyone is welcome to copy my post!)
Floor 17 Posted 2008-03-02 04:18 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 2,268
Posts 879
Joined 2006-12-19 16:23
19-year member
UID 73968
Gender Male
Status Offline
Hahaha, brother plp626 has a misunderstanding.
What I mean is that how to open folders with dots is not a new topic.
It's not that your article is not original, but that I don't agree with the view you explained in extra-large font in floor 14.

You said "To access a directory with a dot, you don't have to use start...".
I mean what you are accessing is the information of the 123 directory. In fact, the directory 123..\ still exists, and the content inside can't be seen by double-clicking the newly created 123 directory. It's also impossible to delete it.
致精致简!
Floor 18 Posted 2008-03-02 14:11 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Sweat~ I mean my red highlighted part is original.

I don't know if my Chinese is not up to standard~ It's not understandable like this, so I have to write an example.


@echo off
md D:\Test
cd /d D:\Test
echo Generate test file
echo I am Slore>Test text.txt
echo.
echo Create abnormal directory Slore.
md Slore..\
echo.
echo Copy test file.
copy Test text.txt Slore..\

echo Create folder to access Slore.
md Slore...\
echo.
echo.
echo See if you can see the file by double-clicking the Slore.. directory?
echo See if you can run that text by double-clicking it again?
start %cd%
pause>nul
echo.
echo.
echo Now see the attribute is 0
I said that if we want to view the attribute, we need to create a dot-free directory.
Create empty directory Slore
md Slore
echo Now see the attribute.
pause>nul
Set /p dp=Do you want to delete the Test directory now? (y/n)
cd\
if "%dp%"=="y" rd /s /q D:\test

echo.
echo Demo is complete!
pause>nul


Use your own eyes to see if you can access it!!!




If the picture can't be seen directly, click this link to see it.
Floor 19 Posted 2008-03-02 16:28 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Then I'm sorry.
But what brother slore said is not entirely correct. That would only be effective for the first - level abnormal directory.

For example, execute (please paste the following code into the command line, some folders cannot be created with batch! )

md test&cd test&echo plp626>1.txt
md plp1..\ plp1..\plp2..\
copy . plp1..\plp2..\

The 1.txt file is copied to the plp1..\plp2..\ path.
But then use your method to create:
md plp1...\
md plp1...\plp2...\

Only the folder plp2 can be seen under the plp1.. directory.
Even if you "add more dots" to create directories
md plp1....\ plp1....\plp2....\
md plp1.....\ plp1......\
You still can't access the copied file with the mouse.
It seems that this "adding more dots" method always makes it impossible for the mouse to access the abnormal directory within the abnormal directory!
Brother, do you have any other methods?

[ Last edited by plp626 on 2008 - 3 - 2 at 04:53 PM ]
Floor 20 Posted 2008-03-02 17:40 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Please understand what I said in the 14th floor.

Change your second code segment to:


md plp1...\
md plp1..\plp2...\


See if it can be accessed... Please understand. I'm going to school, you can take your time to see.
Compare the differences by yourself where they are.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
plp626 +3 2008-03-02 19:42
Floor 21 Posted 2008-03-02 19:41 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
You this is original. Collected
Floor 22 Posted 2008-03-05 19:05 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
My most feared thing
md con\
md con\nul\
This... will be very scary, right...
Floor 23 Posted 2008-03-05 23:09 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
rd /q/s con\nul\
rd /q/s con\
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 24 Posted 2008-03-07 18:07 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
It is said like this... Please forgive me for finding fault...
Viruses can also increase incrementally... Multiple different types of deformities...
It may also be that I am overthinking... I hope the virus won't be too abnormal... But viruses shouldn't be so complicated...
Floor 25 Posted 2008-03-07 21:14 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Viruses may be more perverse than you think,
But no matter how perverse can be eliminated, I have an idea (for discussion):
Use 2>&1 to get the deep path of the abnormal directory, and then use for to analyze the path to eliminate all abnormal directories should be no problem,
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 26 Posted 2008-03-08 18:41 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Ah... I didn't understand 2>&1... Let's learn first...

[ Last edited by 523066680 on 2008-3-8 at 07:01 PM ]
Floor 27 Posted 2008-03-08 18:41 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Actually, if the virus also adds cacls, it will be very... Ali roast duck...
Floor 28 Posted 2008-03-08 19:32 ·  中国 湖北 武汉 电信
初级用户
Credits 108
Posts 49
Joined 2008-02-26 18:54
18-year member
UID 111491
Gender Male
Status Offline
Originally posted by plp626 at 2008-3-5 11:09 PM:
rd /q/s con\nul\
rd /q/s con\


If there are still directories under con\nul\, the command rd /q/s con\nul\ is invalid, and rd /q/s con\ is universal.
Floor 29 Posted 2008-03-09 01:36 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
You guys don't push me, I just don't want to write.
No matter how "weird" the directory is, you can just click it once and everything is done.
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 30 Posted 2008-03-09 10:42 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Reading the post, I can tell you're way more capable than me... Teach a noob like me, please
Forum Jump: