It is currently March 28th, 2024, 3:59 pm

External USB dvd script read, write and space

Get help with creating, editing & fixing problems with skins
Big
Posts: 19
Joined: February 12th, 2017, 4:19 pm

External USB dvd script read, write and space

Post by Big »

I won't to know if is possible to have some script to my usb dvd writer. I need for read, write et free space on it. If some body have script for this, let's me know because I don't found. Thanks in advance.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: External USB dvd script read, write and space

Post by balala »

Big wrote:I won't to know if is possible to have some script to my usb dvd writer. I need for read, write et free space on it. If some body have script for this, let's me know because I don't found. Thanks in advance.
I'd say that for a such thing you should use the FreeDiskSpace measure, but for the CDs/DVDs, this measure doesn't support other than Type and Label. This means that you can find out the type of the drive (which we know is 6 or CDRom - according to the values returned by this measure, for the Type=1 option) and the label of the disk, nothing else.
However I'm not very sure what you mean by: you "need for read, write".
Big
Posts: 19
Joined: February 12th, 2017, 4:19 pm

Re: External USB dvd script read, write and space

Post by Big »

Sorry, my english is very bad but I try to explain.

On my desktop I have read, write, free and used space graph for all my hdd.

I use the same script for my usb key and juste change HDD for USB and is work perfectly.

I have a dvd/cd writer external in usb but is not possible to have same informations of HDD or USB KEY. I try many transformation in my script but never show something. Always shows 100% full and my graph line stay to 0 b/s.

If some script work for what I need, I never found. I want to know if is possible or not to create or have this kind of script.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: External USB dvd script read, write and space

Post by balala »

Big wrote:On my desktop I have read, write, free and used space graph for all my hdd.

I use the same script for my usb key and juste change HDD for USB and is work perfectly.
I suppose with a Rainmeter skin, right?
Big wrote:I have a dvd/cd writer external in usb but is not possible to have same informations of HDD or USB KEY. I try many transformation in my script but never show something. Always shows 100% full and my graph line stay to 0 b/s.

If some script work for what I need, I never found. I want to know if is possible or not to create or have this kind of script.
I'm not saying for sure it's not possible, but for sure I can say it's not with simple Rainmeter measures, because, as I said above, the FreeDiskSpace measures don't return such information for CDs/DVDs. For this kind of drives, it returns just the type of the drive (which we know is 6/CDRom) and its label.
It won't be an easy stuff to find out what you'd need. Maybe you'll have to use some external third party app. Should find one but at least yet I can't recommend one.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: External USB dvd script read, write and space

Post by balala »

Ok, it seems I found a solution, which doesn't require to install any app. It uses the fsutil.exe Windows app, and can tell the amount of the used disk space, but not more. I think that on a CD or DVD, the free space can't even be defined. If I'm not wrong, you won't be able to read it.
So, please take a look at the following code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!CommandMeasure MeasureRun "Run"]

[Variables]
Drive=

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=fsutil.exe volume diskfree #Drive#
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\n":"","Total # of free bytes        : 0Total # of bytes             : (\d*)Total # of avail free bytes  : 0":"\1"
FinishAction=[!ShowMeter "MeterRun"]

[MeasureSize]
Measure=Calc
Formula=[MeasureRun]
DynamicVariables=1

[MeterResult]
MeasureName=MeasureSize
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Used on #Drive# %1B
AutoScale=1

[MeterRun]
Meter=String
Padding=15,5,15,5
X=0r
Y=3R
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Click to Rerun
LeftMouseUpAction=[!CommandMeasure MeasureRun "Run"]
Hidden=1
First take care to add the Drive variable, accordingly to your DVD (Eg Drive=d:). See that when the skin is refreshed, the OnRefreshAction option of the [Rainmeter] section runs the [MeasureRun] measure, which will return the amount of the used disk space (through the fsutil.exe app). The Substitute option of the [MeasureRun] measure will keep just the amount of the used space, the surrounding texts will be removed. In this moment, the [MeasureSize] measure will take over this value. I needed to add a such measure to can scale the value in the appropriate string meter (in this case the [MeterResult] meter).
And finally I also added a [MeterRun] meter, to can rerun the [MeasureRun] measure, without needing to refresh the skin. You'll need to do this for example when you'll change the inserted disk.
Please let me know if this simple solution, at least partially, covers your needs.
Big
Posts: 19
Joined: February 12th, 2017, 4:19 pm

Re: External USB dvd script read, write and space

Post by Big »

I try your script and modified the letter for go to my usb dvd but noting happen.
I work on a script i use for my usb stick, work good on it but not on my usb dvd. If some one wont correct this one, i appreciate.

Code: Select all

USB=G:
SpeedFanIndex=3

[BG]
Meter=Image
ImageName=#SKINSPATH#\Office\Common\Images\Double-Bar.png
ImageTint=#ImageTint#
LeftMouseUpAction=!Execute [#USB#]

;======================================================
;MEASURES
;======================================================

[Measure.Drive_Access]
Measure = Plugin
Plugin = PerfMon.dll
PerfMonObject = LogicalDisk
PerfMonCounter = "Disk Bytes/sec"
PerfMonInstance = "#USB#"

[Measure.Drive_Read]
Measure = Plugin
Plugin = PerfMon.dll
PerfMonObject = LogicalDisk
PerfMonCounter = "Disk Read Bytes/sec"
PerfMonInstance = "#USB#"

[Measure.Drive_Write]
Measure = Plugin
Plugin = PerfMon.dll
PerfMonObject = LogicalDisk
PerfMonCounter = "Disk Write Bytes/sec"
PerfMonInstance = "#USB#"

[Measure.Drive_Used]
Measure=FreeDiskSpace
Drive=#USB#
InvertMeasure=1

[Measure.Drive_Size]
Measure=FreeDiskSpace
Drive=#USB#
Total=1

[Measure.Drive_Free]
Measure = FreeDiskSpace
IgnoreRemovable = 0
Drive = "#USB#"
UpdateDivider = 3

;======================================================
;Meters
;======================================================

[USBWRITEGraphLine]
Meter=Line
MeasureName=Measure.Drive_Write
X=4
Y=40
H=52
W=100
LineCount=1
LineColor=#Color1#
AutoScale=2

[USBREADGraphLine]
Meter=Line
MeasureName=Measure.Drive_Read
X=4
Y=21
H=32
W=100
LineCount=1
LineColor=#Color2#
AutoScale=2

;======================================================
;Strings
;======================================================

[GPU1TitleString]
Meter=STRING
Text=#USB# CLÉ USB
Y=-3
MeterStyle=TitleStyle

[FreeDrivePercent]
Meter=STRING
MeasureName=Measure.Drive_Free
X=196
Y=-2
StringAlign=Right
AntiAlias=1
Percentual=1
Prefix="Free: "
Percentual = #Yes#
PostFix = "%"
UpdateDivider = 3
MeterStyle=AllStyle

[Writestring]
Meter=STRING
MeasureName=Measure.Drive_Write
X=196
Y=77
StringAlign=Right
AntiAlias=1
AutoScale=1
NumOfDecimals=0
Prefix="[W] "
Postfix="B/s"
MeterStyle=AllStyle

[Readstring]
Meter=STRING
MeasureName=Measure.Drive_Read
X=196
Y=37
StringAlign=Right
AntiAlias=1
AutoScale=1
NumOfDecimals=0
Prefix="[R] "
Postfix="B/s"
MeterStyle=AllStyle
Tanks in advance....... :thumbup:
Last edited by fonpaolo on February 12th, 2017, 9:27 pm, edited 1 time in total.
Reason: Please use the [code] tags
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: External USB dvd script read, write and space

Post by balala »

Big wrote:I try your script and modified the letter for go to my usb dvd but noting happen.
I'm surprised! It works very well for me. Have you tried my code with a hard disk partition? Is it working with a such drive?
Please copy the code of your skin, as you have it now and post it. I'd like to check it one more time.
Big wrote:I work on a script i use for my usb stick, work good on it but not on my usb dvd. If some one wont correct this one, i appreciate.
As I said, the FreeDiskSpace measures aren't working for CDs or DVDs, neither for an internal drive and much less for an external one. So, the [Measure.Drive_Used], [Measure.Drive_Size] and [Measure.Drive_Free] measures won't return anything (well, in fact they will return 0). In plus, if you want to get some data on a FreediskSpace measure, for a removable drive, you have to add to all these measures the IgnoreRemovable=0 option, to tell those measure they have to not ignore the removable drives, which they do by default. Because these options aren't used anywhere, excuse me, but I doubt that the posted code works for a USB stick.
Big
Posts: 19
Joined: February 12th, 2017, 4:19 pm

Re: External USB dvd script read, write and space

Post by Big »

Code: Select all

USB=G:
SpeedFanIndex=3

[BG]
Meter=Image
ImageName=#SKINSPATH#\Office\Common\Images\Double-Bar.png
ImageTint=#ImageTint#
LeftMouseUpAction=!Execute [#USB#]

;======================================================
;MEASURES
;======================================================

[Measure.Drive_Access]
Measure = Plugin
Plugin = PerfMon.dll
PerfMonObject = LogicalDisk
PerfMonCounter = "Disk Bytes/sec"
PerfMonInstance = "#USB#"

[Measure.Drive_Read]
Measure = Plugin
Plugin = PerfMon.dll
PerfMonObject = LogicalDisk
PerfMonCounter = "Disk Read Bytes/sec"
PerfMonInstance = "#USB#"

[Measure.Drive_Write]
Measure = Plugin
Plugin = PerfMon.dll
PerfMonObject = LogicalDisk
PerfMonCounter = "Disk Write Bytes/sec"
PerfMonInstance = "#USB#"

[Measure.Drive_Used]
Measure=FreeDiskSpace
Drive=#USB#
InvertMeasure=1

[Measure.Drive_Size]
Measure=FreeDiskSpace
Drive=#USB#
Total=1

[Measure.Drive_Free]
Measure = FreeDiskSpace
IgnoreRemovable = 0
Drive = "#USB#"
UpdateDivider = 3

;======================================================
;Meters
;======================================================

[USBWRITEGraphLine]
Meter=Line
MeasureName=Measure.Drive_Write
X=4
Y=40
H=52
W=100
LineCount=1
LineColor=#Color1#
AutoScale=2

[USBREADGraphLine]
Meter=Line
MeasureName=Measure.Drive_Read
X=4
Y=21
H=32
W=100
LineCount=1
LineColor=#Color2#
AutoScale=2

;======================================================
;Strings
;======================================================

[GPU1TitleString]
Meter=STRING
Text=#USB# CLÉ USB
Y=-3
MeterStyle=TitleStyle

[FreeDrivePercent]
Meter=STRING
MeasureName=Measure.Drive_Free
X=196
Y=-2
StringAlign=Right
AntiAlias=1
Percentual=1
Prefix="Free: "
Percentual = #Yes#
PostFix = "%"
UpdateDivider = 3
MeterStyle=AllStyle

[Writestring]
Meter=STRING
MeasureName=Measure.Drive_Write
X=196
Y=77
StringAlign=Right
AntiAlias=1
AutoScale=1
NumOfDecimals=0
Prefix="[W] "
Postfix="B/s"
MeterStyle=AllStyle

[Readstring]
Meter=STRING
MeasureName=Measure.Drive_Read
X=196
Y=37
StringAlign=Right
AntiAlias=1
AutoScale=1
NumOfDecimals=0
Prefix="[R] "
Postfix="B/s"
MeterStyle=AllStyle





I try for my usb dvd to put '' IgnoreRemovable = 0 '' but noting change, the free space is 100% and graph no work. For my usb stick, all fonction work, graph and free space.

I'm sure it's just a little problem with the script but where...... :?
Attachments
USB STICK.jpg
Last edited by fonpaolo on February 12th, 2017, 9:56 pm, edited 1 time in total.
Reason: Please use the [code] tags
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: External USB dvd script read, write and space

Post by mak_kawa »

Your USB DVD drive is recognized as "DVD/CD-ROM drive" in device manager of WINDOWS? If so, Perfmon doesn't(can't) measure Disk Read/Write Bytes from your USB DVD drive, I think.
Big
Posts: 19
Joined: February 12th, 2017, 4:19 pm

Re: External USB dvd script read, write and space

Post by Big »

Ok but with Rainmeter....in plug-in, no .dll is possible to take the gestion of this.?

Excuse my English.....
Post Reply