中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-10 06:57
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » WMIC关于GET NAME的怪事! 查看 744 回复 5
楼 主 WMIC关于GET NAME的怪事! 发表于 2008-11-07 20:11 ·  中国 福建 漳州 联通
中级用户
★★
积分 228
发帖 125
注册 2008-08-25 19:17
17年会员
UID 124135
性别 男
状态 离线
wmic datafile where "drive='g:' and Extension<>'bat' and path='\\a\\kg\\'" get * /value

以上命令将会列出g:\a\kg目录下非.bat的文件..

但是我用get name就是无法获取文件名..但是事实上get * /value里面我就看到了有Name这个列..真是见鬼了...一直琢磨不清楚怎么做呢..

还请各位高手多多帮忙
2 发表于 2008-11-07 21:27 ·  中国 福建 漳州 联通
中级用户
★★
积分 228
发帖 125
注册 2008-08-25 19:17
17年会员
UID 124135
性别 男
状态 离线
看来的确有难度的哦.哎..
3 发表于 2008-11-07 22:41 ·  中国 陕西 西安 电信
铂金会员
★★★★
积分 5,212
发帖 2,478
注册 2007-02-08 23:39
19年会员
UID 79003
性别 男
状态 离线
C:\Documents and Settings\Administrator>wmic datafile where "drive='c:' and Exte
nsion='exe' and path='\\windows\\'" get Name /value


Name=c:\windows\alcrmv.exe


Name=c:\windows\alcupd.exe


Name=c:\windows\explorer.exe


Name=c:\windows\hh.exe


Name=c:\windows\isun0804.exe


Name=c:\windows\isuninst.exe


Name=c:\windows\notepad.exe


Name=c:\windows\regedit.exe


Name=c:\windows\soundman.exe


Name=c:\windows\taskman.exe


Name=c:\windows\twunk_16.exe


Name=c:\windows\twunk_32.exe


Name=c:\windows\winhelp.exe


Name=c:\windows\winhlp32.exe




C:\Documents and Settings\Administrator>wmic datafile where "drive='c:' and Exte
nsion='exe' and path='\\windows\\'" get Name
Name
c:\windows\alcrmv.exe
c:\windows\alcupd.exe
c:\windows\explorer.exe
c:\windows\hh.exe
c:\windows\isun0804.exe
c:\windows\isuninst.exe
c:\windows\notepad.exe
c:\windows\regedit.exe
c:\windows\soundman.exe
c:\windows\taskman.exe
c:\windows\twunk_16.exe
c:\windows\twunk_32.exe
c:\windows\winhelp.exe
c:\windows\winhlp32.exe


C:\Documents and Settings\Administrator>
S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore
4 发表于 2008-11-08 12:41 ·  中国 福建 漳州 联通
中级用户
★★
积分 228
发帖 125
注册 2008-08-25 19:17
17年会员
UID 124135
性别 男
状态 离线
我知道了
5 发表于 2008-11-08 12:42 ·  中国 福建 漳州 联通
中级用户
★★
积分 228
发帖 125
注册 2008-08-25 19:17
17年会员
UID 124135
性别 男
状态 离线
但是如果Extension<>的话就无法取得name
要是=就可以,怎么这就怪了啊。郁闷
6 发表于 2008-11-08 14:02 ·  中国 湖北 武汉 联通
版主
★★★★★
积分 11,386
发帖 4,938
注册 2006-07-23 17:10
20年会员
UID 59080
状态 离线
用 != 代替 <> 表示不等于。
wmic datafile where "drive='g:' and Extension!='bat' and path='\\a\\kg\\'" get name
论坛跳转: