Hello everyone,
I am totally new to visual basic script and I am not sure if I will need it for more than my current problem. I need a simple VBScript to check the remaining power in a notebook battery and save the percentage into a text-file. This script is executed from another programm on load.
I am already able to create a text file. I searched the web the last two days and found a lot of visual basic code but when I tried to run this in my VBScript I got a lot of errors. I narrowed down retrieving the battery information to the following code lines:
Dim psBattery As SystemInformation = SystemInformation.PowerStatus
Dim perFull As String = psBattery.BatteryLifePercent
BUT it is not working. I think it is the declaration with "As" that's causing the problem. Or am I doing this in a totally wrong way?
Can anyone help me with that? That would be great!
Thanks in advance,
Christine
I am totally new to visual basic script and I am not sure if I will need it for more than my current problem. I need a simple VBScript to check the remaining power in a notebook battery and save the percentage into a text-file. This script is executed from another programm on load.
I am already able to create a text file. I searched the web the last two days and found a lot of visual basic code but when I tried to run this in my VBScript I got a lot of errors. I narrowed down retrieving the battery information to the following code lines:
Dim psBattery As SystemInformation = SystemInformation.PowerStatus
Dim perFull As String = psBattery.BatteryLifePercent
BUT it is not working. I think it is the declaration with "As" that's causing the problem. Or am I doing this in a totally wrong way?
Can anyone help me with that? That would be great!
Thanks in advance,
Christine