|
chainliq
高级用户
    学无尽止
积分 635
发帖 244
注册 2006-4-15 来自 广西贵港
状态 离线
|
『楼 主』:
dir 为什么不能查找隐藏的系统文件{已结}
如下:
dir/s D:\_desktop.ini 2>nul&&call "D:\Program Files\ICO\logop.js"
这个应该是展开查找D盘下所有文件夹下的_desktop.ini 如果有这个文件的话就执行 "D:\Program Files\ICO\logop.js"
但经过测试
如果 _desktop.ini 文件的属性不是隐藏的话,就可以执行后面那一段,可现在这个文件生成的时候是隐藏的系统文件,运行这个脚本的时候,它没有运行后面那一段! 希望能身各位讨教几招! 谢谢
[ Last edited by chainliq on 2006-11-19 at 04:30 PM ]
附件
1: 1.BMP (2006-11-17 16:13, 19.35 K, 下载附件所需积分 1 点
,下载次数: 5)
|
|
2006-11-17 16:13 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
|
2006-11-17 17:08 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第
3 楼』:
dir /a
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-11-18 00:09 |
|
|
sdb001
新手上路

积分 4
发帖 2
注册 2006-11-18
状态 离线
|
|
2006-11-18 09:25 |
|
|
shiyi3399
新手上路

积分 3
发帖 1
注册 2006-11-15 来自 广东
状态 离线
|
|
2006-11-18 16:05 |
|
|
chainliq
高级用户
    学无尽止
积分 635
发帖 244
注册 2006-4-15 来自 广西贵港
状态 离线
|
『第
6 楼』:
嗨,还是不行呀,还是不行呀,不然你们可以试一下,在D里随便一个文件夹建立一个 _desktop.ini 看看,还是找不出来挖,
我想不用dir ,用其它语句,比如用 if exist 怎么写呢
是这样吗:if existD\_desktop.ini /a call ":\Program Files\ICO\logop.js"
可是这样也不行呀```````
有点儿急用,请各位帮忙OY!
[ Last edited by chainliq on 2006-11-18 at 09:07 PM ]
附件
1: 1.jpg (2006-11-18 21:06, 11.52 K, 下载附件所需积分 1 点
,下载次数: 1)
|
|
2006-11-18 21:02 |
|
|
playking
初级用户
 
积分 35
发帖 13
注册 2006-9-8
状态 离线
|
『第
7 楼』:
dir /a/s
能不能把你的JS发出来瞧瞧
|
|
2006-11-18 22:48 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
  『第
8 楼』:
dir /a /b /s D:\*desktop*
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-11-19 00:13 |
|
|
redtek
金牌会员
     
积分 2902
发帖 1147
注册 2006-9-21
状态 离线
|
 『第
9 楼』:
dir /as d:\_desktop.ini(这个 Dir /as 来显示所有目录下的隐藏文件的命令不正确)
上面不正确的 /as 参数是找不到_desktop.ini隐藏文件的~:)
(详见第6楼就是使用上面错误的命令参数,所以找不到~:)
(这个错误的命令参数本身并不是错误的,但会事得其反)
(因为 dir /AS 和 dir /A /S 的命令代表执行的本质意义是完全不同的)
必须这样书写命令:
dir /a /s d:\_desktop.ini
只有这样加 /a /s参数才可以找到你指定D盘的所有目录下的_desktop.ini隐藏文件。
) 使用IF判断这个文件是否存在:
if exist d:\_desktop.ini echo 找到_desktop.ini文件!
另:上面这句只是使用IF判断文件是否存在的一个原型,并不实用~:)
具体的操作楼主可以自行增添更多内容~:)
注: Dir /a /s 这样写~:)
Dir /as 不要这样写,太节俭了有时候会丢东东的~:)
------------------------------------------------------------------------------------------------------
(因为 dir /AS 和 dir /A /S 的命令代表执行的本质意义是完全不同的)
DIR /AS d:\_desktop.ini
(当使用上面 /AS 命令查找指定盘文件时,代表意义为:查找具有“系统S”属性的文件)
(楼主的那个 _desktop.ini 根本就不是具有S系统属性的文件,所以一定找不到)
(可以 ATTRIB _desktop.ini看一下就知道了)
(什么情况下使用 DIR /AS _desktop.ini 可以找到文件?)
当 _desktop.ini 具备如下属性时,即具有S系统属性时可以找到:
A SH D:\_desktop.ini
上面的S标置为系统属性,H为隐含属性……
DIR /A /S d:\_desktop.ini
(当使用上面 /A /S 参数时,意义是指:在所有指定路径(盘符)的目录下查找隐藏属性的文件 _desktop.ini)
(但如果 _desktop.ini 为非隐藏属性也可以找到~:)
这里的单独的 /S 参数代表“所有”的含义。
[ Last edited by redtek on 2006-11-18 at 11:46 AM ]
|

Redtek,一个永远在网上流浪的人……
_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._ |
|
2006-11-19 00:27 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-11-19 00:36 |
|
|
chainliq
高级用户
    学无尽止
积分 635
发帖 244
注册 2006-4-15 来自 广西贵港
状态 离线
|
『第
11 楼』:
呵呵,听啦 redtek 兄的一翻解释,真是受益匪浅呀,谢谢,非常感谢谢各位的帮忙,问题以解决!
|
|
2006-11-19 16:30 |
|
|
vlq5299
初级用户
 
积分 136
发帖 59
注册 2006-6-2
状态 离线
|
『第
12 楼』:
dir/a/s/b D:\_desktop.ini 2>nul&&"D:\Program Files\ICO\logop.js"
???
|
|
2006-12-5 03:25 |
|
|
tathatayx
初级用户
 
积分 23
发帖 11
注册 2006-11-7 来自 四川成都
状态 离线
|
|
2006-12-5 23:18 |
|