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-27 01:49
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] vbs version of Tree View 2,626 Replies 23
Floor 16 Posted 2010-03-27 19:33 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Change
on Error Resume Next '容错模式(忽略特殊文件夹错误)

to:
'on Error Resume Next '容错模式(忽略特殊文件夹错误)

Let's take a look at the prompt message, it is estimated to be a permission issue.
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 17 Posted 2010-03-28 11:14 ·  中国 广东 梅州 电信
中级用户
★★
Credits 262
Posts 129
Joined 2007-07-11 06:50
18-year member
UID 93679
Gender Male
Status Offline
I hope all file sizes can be precise to the hundredth place.

For example
218.12MB
1.02GB
35.60KB
Floor 18 Posted 2010-03-28 11:37 ·  中国 陕西 汉中 电信
初级用户
★★
Credits 128
Posts 122
Joined 2009-09-21 06:24
16-year member
UID 152378
Gender Male
Status Offline
Support
Floor 19 Posted 2010-03-28 21:09 ·  中国 北京 丰台区 联通
初级用户
Credits 33
Posts 32
Joined 2006-02-21 23:08
20-year member
UID 50740
Gender Male
Status Offline
slore, this VBS cannot complete directory recursion normally on my system. But after looking at the code for a long time, I can't find anything wrong...
Floor 20 Posted 2010-03-28 22:24 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Originally posted by tachyon at 2010-3-28 21:09:
slore, this vbs cannot complete directory recursion normally on my system.
But after looking at the code for a long time, I can't find anything wrong...



The code logic is correct... It is estimated that it is a problem with that object. Some folders will inexplicably have no permissions, especially some system folders.
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 21 Posted 2010-03-28 22:26 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Originally posted by kidzgy at 2010-3-28 11:14:
I hope that the size of all files can be accurate to the hundredth place.

For example
218.12MB
1.02GB
35.60KB


Modify the FormatSize function yourself.
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 22 Posted 2010-03-29 12:49 ·  中国 广东 梅州 电信
中级用户
★★
Credits 262
Posts 129
Joined 2007-07-11 06:50
18-year member
UID 93679
Gender Male
Status Offline
Sorry, I know nothing about this. Specifically, how to change it? What to replace with what?
Floor 23 Posted 2010-03-29 13:09 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
```vbnet
Function FormatSize(SZ)
Dim i
Do While SZ > 1024
i = i + 1
SZ = SZ / 1024
Loop
FormatSize = " (" & Round(SZ, 2) & Mid(Unit4Size, 1 + 2 * i, 2) & ")"
End Function
```
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
Floor 24 Posted 2010-03-29 19:31 ·  中国 广东 梅州 电信
中级用户
★★
Credits 262
Posts 129
Joined 2007-07-11 06:50
18-year member
UID 93679
Gender Male
Status Offline
It's done. Thanks a lot~
Forum Jump: