(windows scripting) Could use some help!

Welcome to CPAElites - the original incentive CPA affiliate marketing forum online, solely based on "Cost Per Action".

Be a part of something great, join today! Learn CPA marketing with CPAElites, we will teach you everything such as the best CPA networks, CPA offers with highest payouts and best conversion rates, unsaturated CPA niches, most effective traffic sources and more.

DutchPride

Well-known member
VIP Legends CPAElites Classic (1.0)
VIP Elites CPAElites Classic (1.0)
Joined
May 14, 2013
Messages
5,416
Reaction score
0
Location
The Netherlands.
Website
www.cpaelites.com
Hello all.

So basicly for school i needed to code a program wich shows the available space for every partition i have made in my laptop.
But when i run it all the partitions comes seperatley.

This is what i get:

ddZLSlz.png


Current code:

Code:
Const CONVERSION_FACTOR = 1048576
Computer = "."
Set objWMIService = GetObject("winmgmts://" & Computer)
Set colLogischeSchijf = objWMIService.InstancesOf ("Win32_LogicalDisk")
For Each objLogicalDisk in ColLogischeSchijf
	FreeMegaBytes = objLogicalDisk.Freespace / CONVERSION_FACTOR
	Wscript.Echo objLogicalDisk.DeviceID & " " & Int(FreeMegaBytes)
	Next

When i click on OK the first box dissapears and then the D partition comes up.

How can i get these to be displayed on one box?

Any help would be much appreciated.

Regards,
DutchPride
 

Zack

Well-known member
Joined
May 12, 2013
Messages
69
Reaction score
0
Code:
Const CONVERSION_FACTOR = 1048576
Computer = "."
Output = ""
Set objWMIService = GetObject("winmgmts://" & Computer)
Set colLogischeSchijf = objWMIService.InstancesOf ("Win32_LogicalDisk")
For Each objLogicalDisk in ColLogischeSchijf
	FreeMegaBytes = objLogicalDisk.Freespace / CONVERSION_FACTOR
	Output = Output + objLogicalDisk.DeviceID & " " & Int(FreeMegaBytes) & vbCrLf
Next
Wscript.Echo Output
 

DutchPride

Well-known member
VIP Legends CPAElites Classic (1.0)
VIP Elites CPAElites Classic (1.0)
Joined
May 14, 2013
Messages
5,416
Reaction score
0
Location
The Netherlands.
Website
www.cpaelites.com
Zack said:
Code:
Const CONVERSION_FACTOR = 1048576
Computer = "."
Output = ""
Set objWMIService = GetObject("winmgmts://" & Computer)
Set colLogischeSchijf = objWMIService.InstancesOf ("Win32_LogicalDisk")
For Each objLogicalDisk in ColLogischeSchijf
	FreeMegaBytes = objLogicalDisk.Freespace / CONVERSION_FACTOR
	Output = Output + objLogicalDisk.DeviceID & " " & Int(FreeMegaBytes) & vbCrLf
Next
Wscript.Echo Output

Thanks allot man, You saved me allot of headache!
 
 
Top Bottom