It is currently April 19th, 2024, 4:27 am

Using FreeDiskSpace for Network Drive

Get help with creating, editing & fixing problems with skins
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Using FreeDiskSpace for Network Drive

Post by VasTex »

Hey Guys,

First off, I'm new to the forums here so bare with me if I seem lost or something. I've been working with Rainmeter for the last 4 or 5months so I know my way around fairly well. However, I've recently decided to create a variation of one of my personal skins for my work computer. Everything has transferred and all works well, but I would like to add Network Drives to my HDD Monitor. My physical HDD's display properly, but I can't seem to get my Network drives to work. I can access the network drives by clicking on them in my skin just as I can my physical HDDs, but unlike the physical drives, my Network drives don't display free or used space. Instead my Network drives display 0/0b.

Perhaps my issue is a simple type-o, but here's my code and hopefully one of you awesome people out there will know what my issue is.

Code: Select all

[Rainmeter]
Author=VasTex
AppVersion=2003000
Update=100

[MetaData]
Description=
instructions=
License=Creative Commons BY-NC-SA 3.0
Version=1.0

[Variables]
FontName=SPY AGENCY
TextSmall=8
TextLarge=18
ColorText=30,145,255,255
ColorTextEffect=0,0,0,255
ColorBarUsed=30,145,255,255
ColorBarBG=0,65,175,255
Disk1=C:
Disk2=E:
Disk3=V:
Disk4=X:

[StyleCommon]
StringCase=None
StringStyle=Normal
StringEffect=Shadow
FontColor=#ColorText#
FontEffectColor=#ColorTextEffect#
FontFace=#FontName#
FontSize=#TextSmall#
AntiAlias=1

[StyleBar]
BarColor=#ColorBarUsed#
SolidColor=#ColorBarBG#
BarOrientation=HORIZONTAL

;Network Drive #1 = Disk3 = V:

[MeasureDisk3Used]
Measure=FreeDiskSpace
IgnoreRemovable=0
Drive=#Disk3#
InvertMeasure=1
UpdateDivider=30

;Network Drive #2 = Disk4 = X:

[MeasureDisk4Used]
Measure=FreeDiskSpace
IgnoreRemovable=0
Drive=#Disk4#
InvertMeasure=1
UpdateDivider=30

[MeasureDisk3Free]
Measure=FreeDiskSpace
IgnoreRemovable=0
Drive=#Disk3#
InvertMeasure=0
UpdateDivider=30

[MeasureDisk4Free]
Measure=FreeDiskSpace
IgnoreRemovable=0
Drive=#Disk4#
InvertMeasure=0
UpdateDivider=30

[MeterDisk3Label]
Meter=String
MeterStyle=StyleCommon
StringAlign=Left
FontSize=#TextLarge#
X=25
Y=88
Text="#Disk3#"
LeftMouseUpAction=!Execute ["#Disk3#\"]

[MeterDisk3Used]
Meter=String
MeterStyle=StyleCommon
StringAlign=Left
FontSize=#TextSmall#
MeasureName=MeasureDisk3Used
X=60
Y=88
Text="Used=%1B"
NumOfDecimals=0
AutoScale=1
LeftMouseUpAction=!Execute ["#Disk3#\"]

[MeterDisk3Free]
Meter=String
MeterStyle=StyleCommon
StringAlign=Right
FontSize=#TextSmall#
MeasureName=MeasureDisk3Free
X=247
Y=88
Text="Free=%1B"
NumOfDecimals=0
AutoScale=1
LeftMouseUpAction=!Execute ["#Disk3#\"]

[MeterDisk3BarBG]
Meter=Image
X=61
Y=100
W=185
H=8
SolidColor=0,0,0,255
LeftMouseUpAction=!Execute ["#Disk3#\"]

[MeterDisk3Bar]
Meter=Bar
MeterStyle=StyleBar
MeasureName=MeasureDisk3Used
X=63
Y=102
W=181
H=4
LeftMouseUpAction=!Execute ["#Disk3#\"]

[MeterDisk4Label]
Meter=String
MeterStyle=StyleCommon
StringAlign=Left
FontSize=#TextLarge#
X=25
Y=113
Text="#Disk4#"
LeftMouseUpAction=!Execute ["#Disk4#\"]

[MeterDisk4Used]
Meter=String
MeterStyle=StyleCommon
StringAlign=Left
FontSize=#TextSmall#
MeasureName=MeasureDisk4Used
X=60
Y=113
Text="Used=%1B"
NumOfDecimals=0
AutoScale=1
LeftMouseUpAction=!Execute ["#Disk4#\"]

[MeterDisk4Free]
Meter=String
MeterStyle=StyleCommon
StringAlign=Right
FontSize=#TextSmall#
MeasureName=MeasureDisk4Free
X=247
Y=113
Text="Free=%1B"
NumOfDecimals=0
AutoScale=1
LeftMouseUpAction=!Execute ["#Disk4#\"]

[MeterDisk4BarBG]
Meter=Image
X=61
Y=125
W=185
H=8
SolidColor=0,0,0,255
LeftMouseUpAction=!Execute ["#Disk4#\"]

[MeterDisk4Bar]
Meter=Bar
MeterStyle=StyleBar
MeasureName=MeasureDisk4Used
X=63
Y=127
W=181
H=4
LeftMouseUpAction=!Execute ["#Disk4#\"]
I cut out the code for the physical drives and only left in the code that was relevant to the network drives so let me know if you need the full code or something. This code should work fine if you copy and paste it into your own Rainmeter Skins section though.

Thanks in advance guys!
Last edited by VasTex on December 3rd, 2013, 11:20 pm, edited 1 time in total.
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Using FreeDiskSpace for Network Drive

Post by VasTex »

I don't usually 'Bump' posts anywhere, but I've noticed that this has gotten a decent amount of views and yet no answer, so I'm wondering if this is even possible or if it's simply a lost cause?

Anyway, thanks in advance if anyone figures this out ever!
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
User avatar
MaroonED
Posts: 61
Joined: November 6th, 2011, 4:50 pm
Location: Germany

Re: Using FreeDiskSpace for Network Drive

Post by MaroonED »

Hi VasTex,

maybe this doesn't help, but have you assigned a drive letter to your network drive? I have a NAS running in my small network and I've assigned it to drive B:. I had no problem adding this drive to a HDD montitor skin. If this doesn't work let us know and I can post my skin code as a reference.

MaroonED
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Using FreeDiskSpace for Network Drive

Post by VasTex »

It's been quite a while since I last looked at my code since I kind of gave up hope, but I'll check everything when I get back to work Tuesday. I believe that I've assigned a drive, but it's been a while so I could be wrong. Anyway, I'll get back to you as soon as I find out exactly what's what.

Thanks for the reply though! Much appreciated!
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
User avatar
VasTex
Posts: 407
Joined: September 20th, 2012, 3:17 pm
Location: USA - Montana

Re: Using FreeDiskSpace for Network Drive

Post by VasTex »

Sorry,

I completely forgot about this post, but for anyone else looking for answers it does work perfectly fine and in the exact same way that a local drive works. Simply change the drive letter to the letter corresponding to the mapped drive letter of the network drive and you should be good to go.

I'm not sure what my issue was, but if I had to take a guess I'd say that my computer didn't properly connect to the drive as I don't see an issue with my code above aside from the fact that it's old and messy.

I have a version now that's much cleaner and I haven't had an issue with it. If for some reason you're network drive doesn't show up try to check that:

-You're Network Drive is properly mapped
-You're using the right Drive Letter
-You've connected properly to the drive (If it's not connect there will be a red X in 'My Computer' over the Drive - To fix this try restarting your computer or Re-Mapping the Drive)
-You're Meters and Measures are properly named and pointing to the right areas and variables.
01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01101001
01100011 01100001 01101100 00100000 01000010 01100001 01100100 01100001 01110011 01110011
prschwob
Posts: 2
Joined: August 25th, 2020, 7:34 pm

Re: Using FreeDiskSpace for Network Drive

Post by prschwob »

Yes, I can see the usage of a network LOCATION (so, it's not necessary to MAP the location to a drive). My Win 10 - since the 2004 update - refused to remember/reconnect one of my NAS as a drive, so I created a network location instead. And I've added the following to my DISKS portion (Note disk3)

In the following, ignore the "<<<<<<<<<<<<<<<<" which I added to point out the important bits...

Code: Select all

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
; colorBar was 235,170,0,255
colorBar=0,170,235,255
colorBarActivity=200,170,0,255
colorText=255,255,255,205
disk1=C:
disk2=X:
disk3=\\TERA6T\share               <<<<<<<<<<<<<<<<<<
As the label is long (compared to a simple drive letter), I've removed the disk-size from the display (note the line after the commented out line)

Code: Select all

[meterValueDisk3]
Meter=String
MeterStyle=styleRightText
MeasureName=measureUsedDisk3
MeasureName2=measureTotalDisk3
X=200
Y=0r
W=190
H=14
;Text=%1B/%2B used
Text=%1B used                             <<<<<<<<<<<<<<<<<<<<
NumOfDecimals=1
AutoScale=1
Last edited by balala on August 26th, 2020, 10:04 am, edited 1 time in total.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Using FreeDiskSpace for Network Drive

Post by CyberTheWorm »

I have a mapped network drive that works fine over a VPN, the only thing I had to do was assign a drive letter to it.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
prschwob
Posts: 2
Joined: August 25th, 2020, 7:34 pm

Re: Using FreeDiskSpace for Network Drive

Post by prschwob »

Yes, I have two NAS. I assigned both to different drive letters. But since the Win 10 2004 update, at reboot, one of the mapped drives is always disconnected. That's why I decided to use "network location" for that drive (instead of a mapped drive letter) -- and I made the changes above to my Rainmeter so I could still see the used metric. Clicking on that network location on Rainmeter opens the drive, just like the other assigned drive. That solved my problem without the headache of always having to reconnect the disconnect mapped drive.

I attach an image of my meter.
You do not have the required permissions to view the files attached to this post.
Noxxy_Belmont
Posts: 1
Joined: June 5th, 2021, 3:20 am

Re: Using FreeDiskSpace for Network Drive

Post by Noxxy_Belmont »

sorry for a bump but i just wanted to add if someone still struggle a bit.

it depends on how your skin is designed. my custom made 'Xtra Bar' skin uses a variable.txt to make some settings inside resources\variables.txt.
what i found was that the original disks.ini that you normally edit have this line

Code: Select all

[MeasureHD1]
Measure=FreeDiskSpace
Drive=#Drive1#:
and the original variables.txt have this line:

Code: Select all

Drive1=C
if you want a network drive, if you put \\user\folder in this scenario the string rainmeter will use will look like this:

Code: Select all

Drive=\\user\folder:
which won't work.

what i did was to change Drive=#Drive1#: to Drive=#Drive1# in the disks.ini and in the variables.txt edit Drive1=C to Drive1=C:.
this way local drives will work and network drives can also be used as the ':' sign is made by you.

example for variables.txt:

Code: Select all

Drive1=C:
Drive2=\\user\D
Drive3=\\user\E
Drive4=F:
Drive5=\\user\G
Drive6=H:
example for disks.ini:

Code: Select all

[MeasureHD1]
Measure=FreeDiskSpace
Drive=#Drive1#
[MeasureHD2]
Measure=FreeDiskSpace
Drive=#Drive2#
[MeasureHD3]
Measure=FreeDiskSpace
Drive=#Drive3#
[MeasureHD4]
Measure=FreeDiskSpace
Drive=#Drive4#
[MeasureHD5]
Measure=FreeDiskSpace
Drive=#Drive5#
[MeasureHD6]
Measure=FreeDiskSpace
Drive=#Drive6#
OttoWerse
Posts: 1
Joined: November 13th, 2021, 11:24 pm

Re: Using FreeDiskSpace for Network Drive

Post by OttoWerse »

I know this topic is old but it is still the first search result, so I might as well post this here.

This has become an issue for me on Windows 11, I'm not 100% sure what causes this, but my skin will not show mapped network drives on Windows 11 after they reconnected once. The same skin (freshly copied over) will work just fine on another machine running Windows 10.
The drive is definitely properly mapped, I can access it in Explorer, I can play video from it, I can write to it, I see capacity in Explorer, etc.

Possible steps to reproduce (on Win11):
- Map a network drive (D:)
- Change your Disk Measures Drive attribute to "D:"
- Turn off WiFi (Network drive shows up as unreachable, skin turns blank)
- Turn Wifi back on
- The drive will not show up (even after restarting the skin, all of Rainmeter or even the PC)
- It is now gone (not even remapping fixed this for me)

What is absolutely bizarre is that after one drive disappeared, alls other drive shares from the same NAS are also no longer seen by rainmeter, even ones I hadn't added before, but they all show up properly and work fine in Explorer when mapped.

I'm about 99.9% sure this is not actually Rainmeters fault, but it would still be nice to find out why. Also I have no idea where else to talk about this TBH, since the drive is otherwise fully working, just cannot me monitored with Rainmeter...

Has this been happening to anyone else yet? Or does anyone have any idea what could cause this bizarre behaviour? Maybe it is because of how Rainmeter accesses the drives, that there is some sort of new timeout for that in Win11, but not for Explorer since it does it differently? I would appreciate any input on this greatly!