Counting PWB Usage

For general issues related to PWB v2.

Moderators: Tyler, Scott, PWB v2 Moderator

Post Reply
Scott
Site Admin
Site Admin
Posts: 2527
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Counting PWB Usage

Post by Scott »

You can easily count PWB usage with a VBScript from the PWB [Files]StartupScript= setting.

Create a VBScript file and counter file, for example "count.vbs" and "count.txt".

Edit the "count.txt" file and enter a start value such as 1.

Edit the "count.vbs" file and add the following.

Dim TS, FSO, s1
Set FSO = CreateObject("Scripting.FileSystemObject")

Set TS = FSO.OpenTextFile("c:\count.txt", 1)
s1 = TS.ReadAll
TS.Close
Set TS = Nothing

L = (CLng(s1) + 1)
s1 = CStr(L)

Set TS = FSO.CreateTextFile("c:\count.txt", True)
TS.Write s1
TS.Close
Set TS = Nothing

This is directly from the following web site.
http://www.eggheadcafe.com/software/asp ... voice.aspx

Set the "count.vbs' file in the INI file.

[Files]
StartupScript=count.vbs

If you do not have the following set in your INI file you will need to start "count.vbs" from a batch file.

[Browser]
ShellExecuteScripts=True

Each PWB is started the counter will be incremented by one.

--Scott

Post Reply