Hi All,
I'm gearing up for the next release but have run into an issue...
I am putting a button on the front page that when clicked, will send you audit_windows.vbs - you can run or save it.
All good so far.
If you save it, then run it via the command line (as normal), things work as intended.
If you save it and double click on it in Windows Explorer or if you try to run it instead of saving it (from the web page), and error is produced.
Line: 6365 (my line match is below)
Char: 2
Error: Type mismatch
My corresponding line is the "do" line after szPossibleChars = "BCDFGHJKMPQRTVWXY2346789".
Can anyone try running their copy of audit_windows.vbs by double clicking on it and letting me know if it works or not?
PS - for now I have wrapped it in a "on error resume next" and it works, but I'd rather not kludge it like that
EDIT - It gets worse... If I run the script directly from the download then save and run the script (both times successfully submitting the result), I get some oddities.
If I check the Windows CD key after the first submit it's "BBBBB-BBBBB-BBBBB-BBBBB-BBBBB", but after the second submit it shows the correct key. This seems to be related to the "on error resume next" fix - it doesn't error out and proceeds (getting the incorrect key as it goes when run from the web page).
Also, the directly run audit (from the web page) retrieves quite a few software packages (database drivers) that the command line run script does not - and in addition, the Parallels Tools package it listed as un-installed - weird.
So I'm getting different results depending on "how" I run the script. The CD Key is one issue, the additional software is another. It's the same damn code
EDIT #2 - I just tried running it by double clicking, then running via the command line. It seem's to work if you do that... So it's only if you run it directly from the web page that it is not matching.
Thanks in advance.
[code]function getkey(rpk,ver)
' location of key in DigitalProductID changed in Office 2010.
' http://code.google.com/p/msoffice-product-key-decoder/
if ver = "1" then
rpkOffset = 52
else
rpkOffset = 808
end if
i=28
szPossibleChars = "BCDFGHJKMPQRTVWXY2346789"
do
dwAccumulator = 0 : j = 14
do
dwAccumulator = dwAccumulator * 256
dwAccumulator = rpk(j+rpkOffset) + dwAccumulator
rpk(j+rpkOffset) = (dwAccumulator\24) and 255
dwAccumulator = dwAccumulator Mod 24
j = j - 1
loop while j>=0
i=i-1 :
szProductKey = mid(szPossibleChars,dwAccumulator+1,1) & szProductKey
if (((29-i) Mod 6)=0) and (i<>-1) then
i = i - 1 : szProductKey = "-" & szProductKey
end if
loop while i>=0
getkey = szProductKey
end function[/code]