is something like this possible to convert to masm?
Dim VOL_PROD_KEY
VOL_PROD_KEY = Wscript.arguments.Item(0)
VOL_PROD_KEY = Replace(VOL_PROD_KEY,"-","") 'remove hyphens if any
for each Obj in GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf ("win32_WindowsProductActivation")
result = Obj.SetProductKey (VOL_PROD_KEY)
Yes, it is a WMI interface, you'll find a few examples of how to use them on the board. Its going to look a lot more complicated than that script though ;)
ToutEnMasm did an example here:
http://www.masm32.com/board/index.php?topic=8358.0
wow my head is spinning with that one :dazzled:
i think i might be better off shellexecuting that script :dance:
Quote from: ChillyWilly on January 31, 2010, 04:08:28 PM
wow my head is spinning with that one :dazzled:
i think i might be better off shellexecuting that script :dance:
You can execute the script from MASM, I saw an example by Ernie once that executed VB script. I think it used to be in the MASM32 distribution, Hutch would probably still have a copy of it somewhere. Its a pretty good way to attack the problem, though I would probably choose the WMI route but then I'm a bit of a masochist.
Edgar
ChillyWilly,
After reading your post I thought I would check out the Win32_WindowsProductActivation class. I couldn't find that class on my system. I did a search and found out the following.
Quote
Question: Has the Win32_WindowsProductActivation class been removed from Windows Vista? I have a script that I use to activate Windows, but that script no longer works on Windows Vista.
-- HM
Answer: Hello HM, The Win32_WindowsProductActivation class has been removed from Windows Vista. Instead, you need to use these two classes seen here:
SoftwareLicensingService
SoftwareLicensingProduct
Both WMI classes are found in the Root\Cimv2 WMI namespace.
From the 'Hey, Scripting Guy! Blog'
It's the same situation for Windows 7. I just thought I'd let you know.
i believe vista and windows7 both include a file called slmgr.vbs that will do such things , xp didnt include anything like that