Friends,
Is there anything like that http://www.autohotkey.com/docs/commands/DriveGet.htm? Can be in Python ...
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
DriverGet in Eventghost
Re: DriverGet in Eventghost
Some of the stuff is available thru the WMI library. Including Type, Capacity, FS, Label, Serial, freespace, etc.
You first need to add wmi.py to your eventghost main directory.
Then you can pay around with a script like this:
Or:
Or this that demonstrates the ability to use a query (doesn't grab as much info from wmi, shortening processing time) and then further uses disk.Name to only output one variable.:
You first need to add wmi.py to your eventghost main directory.
Then you can pay around with a script like this:
Code: Select all
import wmi
DRIVE_TYPES = {
0 : "Unknown",
1 : "No Root Directory",
2 : "Removable Disk",
3 : "Local Disk",
4 : "Network Drive",
5 : "Compact Disc",
6 : "RAM Disk"
}
c = wmi.WMI ()
for drive in c.Win32_LogicalDisk ():
print drive.Caption, DRIVE_TYPES[drive.DriveType]
#print drive #uncomment this line to get all information displayed
Code: Select all
import wmi
c = wmi.WMI()
for x in c.Win32_DiskDrive():
print xCode: Select all
import wmi
c = wmi.WMI ()
wql = "SELECT Name FROM Win32_LogicalDisk WHERE DriveType <> 0"
for disk in c.query(wql):
print disk.Name- Attachments
-
- wmi.py
- WMI.py file goes in EG main directory
- (46.56 KiB) Downloaded 98 times
Re: DriverGet in Eventghost
Thanks for the explanation, but I wanted to know if the drive is playing or not, just like autohotkey command:
Explanation: http://www.autohotkey.com/docs/commands/DriveGet.htm
WMI library, only checks if the driver was accessed or not.
Another idea??
My temporary script:
Code: Select all
DriveGet, statuscd, statuscd, eWMI library, only checks if the driver was accessed or not.
Another idea??
My temporary script:
Code: Select all
import wmi
import time
e_drive = wmi.WMI(moniker='Win32_LogicalDisk.DeviceID="E:"')
while e_drive.Access == None:
time.sleep(1)
e_drive = wmi.WMI(moniker='Win32_LogicalDisk.DevideID="E:"')