|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
提示:Home版XP无wmic~~~
Tip: Home edition of XP has no wmic~~~
|

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-9-11 21:12 |
|
|
doit2004
新手上路

积分 2
发帖 1
注册 2006-10-2
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
Originally posted by willsort at 2006-7-21 21:56:
Re buddiyar:
wmic 显然不是内部命令,但它是WinXP/03的缺省安装组件,首次运行wmic时,会提示进行安装以完成配置,以后可以在cmd或批处理中直接使 ...
那在NT系统下该怎么办呢?
Then what to do under NT system?
|
|
2006-10-9 04:13 |
|
|
brglng
银牌会员
     永遠的DOS~~~
积分 1200
发帖 466
注册 2005-2-1 来自 上海
状态 离线
|
|
2006-10-9 10:07 |
|
|
lyncom
新手上路

积分 4
发帖 2
注册 2007-5-15
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
有没有关于将光驱映射为%cdrom%的内容
Is there any content about mapping the CD-ROM drive as %cdrom%
|
|
2007-5-15 16:52 |
|
|
axi
中级用户
   脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
Originally posted by gmy at 2006-9-11 21:06:
“可移动磁盘”的字符判断没有考虑到USB-HDD(本地硬盘)的情况。
由于USB-HDD与硬盘均被检测为本地固定磁盘,因此很难用这种方式来判断,但可以考虑以判断新增驱动器的方式,如下VBS:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colEvents = objWMIService.ExecNotificationQuery ("Select * From __InstanceOperationEvent Within 5 Where " _
& "TargetInstance isa 'Win32_LogicalDisk'")
Do While True
Set objEvent = colEvents.NextEvent
If objEvent.TargetInstance.DriveType = 3 Then
If objEvent.Path_.Class = "__InstanceCreationEvent" Then
newdri = objEvent.TargetInstance.DeviceId
Wscript.Echo "新增磁盘盘符为: " & newdri
End If
End If
Loop
Originally posted by gmy at 2006-9-11 21:06:
The character judgment of "removable disk" did not take into account the case of USB-HDD (local hard disk).
Since both USB-HDD and hard disks are detected as local fixed disks, it is difficult to judge in this way, but we can consider the way of judging the newly added drive, as follows VBS:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colEvents = objWMIService.ExecNotificationQuery ("Select * From __InstanceOperationEvent Within 5 Where " _
& "TargetInstance isa 'Win32_LogicalDisk'")
Do While True
Set objEvent = colEvents.NextEvent
If objEvent.TargetInstance.DriveType = 3 Then
If objEvent.Path_.Class = "__InstanceCreationEvent" Then
newdri = objEvent.TargetInstance.DeviceId
Wscript.Echo "The newly added disk drive letter is: " & newdri
End If
End If
Loop
|
|
2007-5-15 21:50 |
|
|
lmm333
初级用户
 
积分 48
发帖 20
注册 2007-10-11
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
我想制作一个批处理,当有U盘接入系统时,能自动检测到U盘盘符并自动进行删除或复制或备份的工作,请高手示范下脚本如何编写。
以前自己写的比较简单且比较死板,只能固定在某个U盘盘符,且需要手动敲键,同时接入两个时就会出错,因为接入时总是有先有后,系统显示盘符也是有先有后的,所以经常只能对先接入的那个完成操作……
I want to make a batch script that can automatically detect the drive letter of a USB flash drive when it is connected to the system and automatically perform operations like deletion, copying, or backing up. Please show me how to write the script. Previously, I wrote a relatively simple and rigid one that could only be fixed on a certain USB flash drive letter and required manual key presses. Also, when two are connected at the same time, it will go wrong because there is always a first and a second when connected, and the system displays the drive letters in a first-come-first-served manner, so often only the first connected one can be operated on...
|
|
2007-10-23 09:39 |
|
|
dooomer
初级用户
 
积分 109
发帖 52
注册 2006-1-3
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
楼上的这个批处理是准备时时刻刻都运行并检测U盘吗?
还是准备放到U盘上,作为U盘 autorun的程序?
后者可能好办一些,可以用cd得到其路径,然后处理一下,分离盘符出来。
Is the batch script upstairs meant to run all the time and detect USB drives at any moment?
Or is it meant to be placed on a USB drive as an autorun program for the USB drive?
The latter might be easier. You can use cd to get its path, then handle it a bit to extract the drive letter.
|
|
2007-10-23 16:06 |
|
|
lmm333
初级用户
 
积分 48
发帖 20
注册 2007-10-11
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
不是啊,想做成一个批处理脚本,需要使用到U盘时,就双击运行,因为工作要测试很多U盘,经常做大批量重复的工作,比如拷入100M到1000M的测试文件,测试完成后再删除……很累很无聊……想做成批处理全自动运行,我要做的就只是插拔U盘就好了,不用再点击鼠标或是键盘……
No, I want to make a batch script. When I need to use a USB drive, I just double-click to run it. Because I need to test many USB drives for work, and often do a lot of repetitive work, such as copying a 100M to 1000M test file, and then deleting it after the test... It's very tiring and boring... I want to make the batch processing run automatically, and all I need to do is plug in and unplug the USB drive, without having to click the mouse or keyboard again...
|
|
2007-10-23 16:24 |
|
|
fei009
新手上路

积分 8
发帖 3
注册 2008-8-19
状态 离线
|
『第 24 楼』:
问一下,3742668,能解释一下你2楼代码的意思吗?
使用 LLM 解释/回答一下
另外检测U盘盘符的原理是什么,仅从盘的名称“可移动磁盘”吗?
另外,DriveType是什么意思?
Additionally, what is the principle of detecting the USB flash drive drive letter? Is it only based on the disk name "Removable Disk"?
Additionally, what does DriveType mean?
|
|
2008-8-19 16:18 |
|
|
HAT
版主
       
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
DriveType表示磁盘类型
0:"Unknown"
1:"可移动磁盘"
2:"本地磁盘"
3:"Network Disk或移动硬盘"
4:"CD-ROM"
5:"RamDisk 内存盘"
DriveType represents the disk type
0: "Unknown"
1: "Removable disk"
2: "Local disk"
3: "Network disk or removable hard disk"
4: "CD-ROM"
5: "RamDisk memory disk"
|

 |
|
2008-8-19 17:24 |
|
|
fei009
新手上路

积分 8
发帖 3
注册 2008-8-19
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
获得U盘盘符能不用wmic 吗?就用内部命令。
Can we get the U disk drive letter without using wmic? Just use internal commands.
|
|
2008-8-20 11:23 |
|
|
popo77
新手上路

积分 6
发帖 4
注册 2008-10-15
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
网上收索了很多,好像都不完美.
有devcon,wmic,vbs
请问有用dos的命令就可以实现的如下功能吗?
自动识别U盘,获得盘符,删除U盘,重新识别U盘.
I searched a lot online, but it seems none are perfect.
There are devcon, wmic, vbs
Is there a way to achieve the following functions using DOS commands?
Automatically identify the USB flash drive, obtain the drive letter, delete the USB flash drive, and re-identify the USB flash drive.
|
|
2010-3-2 17:27 |
|