Hello Everyone,
How can I get my var (MyDrive) in my function to work as the drive specification in Line 4. (I'm counting VBStart as a line, like MS)
[code]
VBSTART
Function DoDriveSpace (MyDrive)
Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='MyDrive')"
end function
VBEND
let>MyDrive="D:"
VBEval>DoDriveSpace(%MyDrive%),SpaceOnD
[/code]
Thanks,
PepsiHog
VBS variable
Moderators: JRL, Dorian (MJT support)
VBS variable
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
Thanks for helping armsys.
SOLVED. I kept playing around and figured it out.
[code]
VBSTART
Function DoDriveSpace(mydrive)
Dim Wazoo
wazoo = "Win32_LogicalDisk.DeviceID=" & "'" & mydrive & "'"
Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get(wazoo)
DoDriveSpace = objLogicalDisk.FreeSpace
end function
VBEND
let>Drive=D:
VBEval>DoDriveSpace("%Drive%"),SpaceOnDrive
mdl>%SpaceOnDrive%
[/code]
Drink Pepsi, Get Fat,
PepsiHog
SOLVED. I kept playing around and figured it out.
[code]
VBSTART
Function DoDriveSpace(mydrive)
Dim Wazoo
wazoo = "Win32_LogicalDisk.DeviceID=" & "'" & mydrive & "'"
Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get(wazoo)
DoDriveSpace = objLogicalDisk.FreeSpace
end function
VBEND
let>Drive=D:
VBEval>DoDriveSpace("%Drive%"),SpaceOnDrive
mdl>%SpaceOnDrive%
[/code]
Drink Pepsi, Get Fat,
PepsiHog
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!