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-06 09:11
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Change folder icon View 2,080 Replies 18
Original Poster Posted 2007-04-07 01:45 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
ffffff

[ Last edited by wudixin96 on 2007-11-2 at 11:59 AM ]
Floor 2 Posted 2007-04-07 03:09 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
attrib +s %currdir%

How to solve this problem that you can modify it in the properties without adding the S attribute?
Floor 3 Posted 2007-04-07 03:15 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
[ Last edited by wudixin96 on 2007-11-2 at 11:59 AM ]
Floor 4 Posted 2007-04-07 04:39 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
This method must add the system attribute to the folder, which is very troublesome, you know? (It seems that the hidden attribute cannot be modified)

So I ask, can you achieve the modification purpose without adding the system attribute?
Floor 5 Posted 2007-04-07 05:05 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
ddd

[ Last edited by wudixin96 on 2007-11-2 at 11:59 AM ]
Floor 6 Posted 2007-04-07 05:07 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
The method of the thread starter doesn't work. There are three problems:

1. Direct drag-and-drop says there is a parameter error;

2. The desktop.ini file is built in the %userprofile%;

3. Manually creating the desktop.ini file and setting the system hidden attribute still doesn't see the effect;
Floor 7 Posted 2007-04-07 05:09 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
It's to add the system attribute to the folder...
Floor 8 Posted 2007-04-07 05:12 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
I'll try again~~
Floor 9 Posted 2007-04-07 05:12 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
[ Last edited by wudixin96 on 2007-11-2 at 11:59 AM ]
Floor 10 Posted 2007-04-07 05:34 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

Try this,

:::::::::::::::::::SetIcon.Bat::::::::::::::::::::::::::
::Put this batch file in the folder you want to process, then drag an exe file with an icon onto this batch file to release it.
@echo off
if exist desktop.ini del /a desktop.ini
echo >%~sdp0desktop.ini
echo IconIndex=0 >>%~sdp0desktop.ini
echo IconFile=%~1 >>%~sdp0desktop.ini
attrib +s +h %~sdp0desktop.ini
attrib +s "%cd%"

Floor 11 Posted 2007-04-07 05:39 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
...

[ Last edited by wudixin96 on 2007-11-2 at 11:59 AM ]
Floor 12 Posted 2007-10-17 16:22 ·  中国 湖北 武汉 中国科学院武汉分院
银牌会员
★★★
Credits 1,187
Posts 555
Joined 2006-12-21 07:35
19-year member
UID 74129
Gender Male
Status Offline
Originally posted by wudixin96 at 2007-4-7 05:39:
I just don't show the current path very much. Variable expansion is not used.
I'll try.


Finally, it works. Thank you lxmxn
But there is a problem with attrib +s %cd%

[ Last edited by wudixin96 on 2007-4-7 at 06:55 AM ]



attrib +s "%cd%"

To deal with directory names with spaces
Floor 13 Posted 2007-10-17 16:55 ·  中国 河南 焦作 联通
新手上路
Credits 19
Posts 15
Joined 2007-10-17 16:20
18-year member
UID 99982
Gender Male
Status Offline
It works very well. Can you explain what the following segment means?
set currdir=%~sdp0
attrib +s %currdir:~0,-1%
Floor 14 Posted 2007-10-17 16:57 ·  中国 河南 焦作 联通
新手上路
Credits 19
Posts 15
Joined 2007-10-17 16:20
18-year member
UID 99982
Gender Male
Status Offline
Hehe, got it. ~~~~~ I found out...
Floor 15 Posted 2007-10-19 01:24 ·  中国 广东 广州 电信
初级用户
Credits 62
Posts 28
Joined 2006-03-14 02:15
20-year member
UID 51994
Status Offline
Originally posted by jhua at 2007-10-17 16:55:
It works well.
Can you explain
set currdir=%~sdp0
attrib +s %currdir:~0,-1%
What does this part mean?

What does this mean?
I don't understand. Can you say it? Thank you.
Forum Jump: