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-12 07:05
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to change the icon for a malformed directory? View 880 Replies 7
Original Poster Posted 2009-06-30 19:37 ·  中国 河北 廊坊 联通
初级用户
Credits 21
Posts 10
Joined 2008-04-28 11:53
18-year member
UID 117164
Gender Male
Status Offline
Under XP
we can use
rd md..\
and similar commands to create all kinds of malformed folders
but we can't use the right-click "Customize Folder" function to assign some other custom icon to them
My idea was to first create a normal directory asdf
then change the custom icon
and finally rename the folder
but I don't know why
when I use
ren asdf md..\
the command won't work
the result is that the folder gets renamed to the md folder

Could an expert please explain why this is?
Also, is there any way to make a custom icon work for a malformed directory?
Floor 2 Posted 2009-07-01 01:44 ·  中国 福建 三明 电信
中级用户
★★
Credits 458
Posts 211
Joined 2006-07-26 19:42
20-year member
UID 59307
Status Offline
No.
┌───────┐
├→学习→实践→┤
└───────┘
Floor 3 Posted 2009-07-01 02:37 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Desktop.ini
[.ShellClassInfo]
IconFile=%SystemRoot%\system32\SHELL32.dll
IconIndex=27

Create a similar INI file like this; it seems the icon can be changed after a reboot
Just change a normal folder and look at how the INI file changes, that should do it

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 4 Posted 2009-07-01 05:58 ·  中国 北京 海淀区 联通
银牌会员
★★★
Credits 2,098
Posts 566
Joined 2007-09-11 07:27
18-year member
UID 97070
Gender Male
Status Offline
1. Create folder a, assign an icon
2. Copy folder a, rename it to b
3. ren b "a../"
Floor 5 Posted 2009-07-01 07:50 ·  中国 广西 玉林 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
21-year member
UID 44210
Status Offline
You also have to use attrib +s to add the system attribute to the directory...

But this kind of directory seems to be ineffective

[ Last edited by zh159 on 2009-6-30 at 18:52 ]
Floor 6 Posted 2009-07-02 01:34 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
The methods from 3L and 4L are both useless for changing the icon of folders ending with a dot
Floor 7 Posted 2009-07-04 03:43 ·  中国 吉林 长春 电信
初级用户
★★
Credits 132
Posts 68
Joined 2008-07-29 20:51
18-year member
UID 122345
Gender Male
Status Offline
...\ much smarter than a..\, you can't even see it try md ...\

F:\BAK\DOS>md ...\

F:\BAK\DOS>rd ...\




This is a batch file to search the whole disk for ...\ folders
@echo off
setlocal enabledelayedexpansion
title made in 2009-4-11
set strLine=----------------------------------------
:FolderFlag
cls&set hideFolder=0&set hideFolder=0&set driveList=
echo.&echo !strLine! [...malformed folder capture]&echo.
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && set driveList=!driveList! !drive!)
for %%i in (!driveList!) do (
if exist %%i\...\nul set /a hideFolder+=1&echo [!hideFolder!]. %%i\...\&set ctrlHideFolder!hideFolder!=%%i\...\&echo.
for /f "delims=" %%j in ('dir /ad /b /s %%i\') do (
if exist %%j\*..\nul set /a hideFolder+=1&echo [!hideFolder!]. %%j\*..\&set ctrlHideFolder!hideFolder!=%%j\*..\&echo.
if exist %%j\...\nul set /a hideFolder+=1&echo [!hideFolder!]. %%j\...\&set ctrlHideFolder!hideFolder!=%%j\...\&echo.))

if not !hideFolder! equ 0 (
echo !strLine! [ F? - view X - exit ]&echo.
set cFolder=&set /p cFolder= Please choose:
for /l %%i in (1,1,!hideFolder!) do if /i "!cFolder!"=="f%%i" start "" "!ctrlHideFolder%%i!"
if /i "!cFolder!"=="x" exit
) else echo [...-type malformed folders found on local disks]&echo.&echo !strLine! [!date! !time! ]&echo.&pause>nul
goto FolderFlag
Floor 8 Posted 2009-07-04 04:47 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
md ...\ can't be used on the NTFS file system
Forum Jump: