Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript to register a screensaver

Status
Not open for further replies.

JROY2011

IS-IT--Management
Aug 24, 2011
12
US
I recently purchased a screensaver called AutoDraw. Everything works fine and dandy, but to make a long story short, I would like to know if there is a way that I could make a VBSCRIPT to fill out the username and password fields under the License tab for the screensaver?

I would need the script to fill out two lines of data (username and password) and then select the register button.

Is this even possible? I have attached a picture of the said screen I am trying to automate.

11jnjaf.png
 
Yep. Use Sendkeys.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
I would like to automate this in a script that I run on startup without having to open the display settings and tabbing over to the License tab. I don't know much about scripting, so any help is appreciated!

I guess what I am asking is for the script to go through these steps:

1. Open Screen Saver Settings screen
2. Open the Settings button for AutoDraw (default screensaver)
3. Tab to License Tab
4. Fill out username and password
5. Submit Register button
6. Close Screen Saver Settings screen

Do you still think this is possible?
 
Behind the scenes? Doubt it. But check for registry settings. They can be changed using a script behind the scenes.

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
I guess so. It doesn't sound like it's possible to do what I am asking through a vbscript.

I have tried using a vbscript to change the registry information, and it works, BUT the binary data changes from PC to PC, therefor I cannot use this method.

It not that big of a deal though. Thank you guys for the help!
 
Curious, what does the binary data contain?

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
There is a license key in a registry folder for the program. If I delete the file, the information in the screen shot above is erased. If I add back a new license key with the same binary data as before, the program shows up as registered and everything works fine. The problem comes if I take that same binary data and try it on a different computer, it fills the username and password boxes with jumbled mess and doesn't register.

These are the scrips I have created to delete the file, and then to recreate the file with the same data. (I must delete the file first after imaging a pc, because after a computer is reimaged, the screen shot above shows a jumbled mess again.



Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set objRegistry=GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\JSR-Productions\AutoDraw"
strValueName = "License"

objRegistry.DeleteValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName

Dim strComputer, objRegistry
Dim strKeyPath, strValueName
Dim strHexValues, arrHexValues, arrDecValues

strComputer = "."

Set objRegistry=GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\JSR-Productions\AutoDraw"
strValueName = "License"
strHexValues = "hex:06,71,16,1C,04,09,08,06,68,70,08,1B,0D,15,17,01,78,73,6b,67,01,75,08,1e,15,1e,0b,62,69,08,7d,70,40,28,23,32,35,60,ce,f9,8d,4b,ea,0f,e8,5c,f5,9f,8f,f6,8b,9c,2f,65,e8,5d,19,e1,a4,e1,e2,d5,6b,72,37,c1,cc,88,09,f1,a5,87,9d,b0,56,8f,8b,39,8f,bf,f3,86,20,e2,59,42,a0,79,34,ac,f8,76,4b,24,d3,53,8c,b0,00,c7,ff,c6,5e,61,8a,61,8b,bc,a5,b6,19,39,dc,e8,bf,38,13,b4,3d,17,33,13,33,14,d2,5f,87,56,4d,93,0a,29,b6,a6,1e,4a,99,14,65,9d,31,27,dc,37,11,c9,aa,58,bb,88,6c,62,3f,7d,c3,57,f0,57,be,7a,5f,b2,87,ec,32,c7,ad,f6,3e,4c,aa,14,c9,a6,0e,33,cd,17,5e,73,1c,5b,ff,ea,b0,d6,fd,0f,a3,24,e4,3c,30,f5,57,63,ba,0c,55,71,9a,1f,28,51,9a,d1,89,04,44,1b,0f,73,fd,0b,b3,c5,66,40,e2,c8,d4,f2,e4,66,d0,b2,be,64,56,b5,41,80,51,a1,c7,91,a4,ea,cf,50,31,8b,0d,71,ca,e5,12,6a,31,de,ea,8d,51,50,f7,ee,18,17,04,1d,7b,07,66,69,1f,10,0e,11,14,20,16,51,4c,9b,ac,7c,4a,01,9c,7a,a0,47,b6,7d,ac,97,a1,4e,09,7c,9f,be,50,8a,ff,59,4b,de,b7,51,1a,6c,46,60,dc,ae,f2,37,e7,5f,df,f0,30,a1,d8,02,ee,77,0d,a5,35,d9,25,6f,12,4b,ff,a7,6c,a2,da,2a,2b,11,a2,65,95,b2,d0,a1,92,92,28,53,3e,6e,c6,08,43,e8,b8,9b,f6,2f,a2,91,30,6f,37,fa,f2,af,73,9b,81,db,b1,99,1b,16,93,d5,7a,af,74,b5,9b,2b,1e,18,14,60,4b,d4,f1,15,4a,32,ff,25,94,ba,0d,34,cb,6b,35,4d,2d,2b,ce,9e,c0,99,3c,b0,94,19,72,99,ed,b7,99,4f,b4,9a,59,3f,84,a5,18,ec,f6,f1,fc,22,33,05,d0,9b,dd,cc,df,df,03,d5,a8,48,aa,e6,35,d3,a2,4c,98,dc,e7,5f,75,06,fa,46,a2,aa,6a,84,86,3e,63,ef,3f,8b,12,69,58,13,11,a1,7c,50,26,22,26,aa,b1,e2,f2,a1,27,7d,1d,e6,97,16,0a,fe,59,b5,c9,50,38,f4,59,d4,c3,bc,83,f9,24,be,2f,10,71,05,a3,03,7d,1d,94,8a,39,b7"

arrHexValues = Split(Replace(strHexValues, "hex:", ""), ",")
arrDecValues = DecimalNumbers(arrHexValues)

objRegistry.SetBinaryValue HKEY_LOCAL_MACHINE, _
strKeyPath, strValueName, arrDecValues

Function DecimalNumbers(arrHex)
Dim i, strDecValues
For i = 0 to Ubound(arrHex)
If isEmpty(strDecValues) Then
strDecValues = CLng("&H" & arrHex(i))
Else
strDecValues = strDecValues & "," & CLng("&H" & arrHex(i))
End If
next
DecimalNumbers = split(strDecValues, ",")
End Function

 
Why is it being converted to decimal values before being written to the registry? Binary data in the registry is HEX

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Also, if the software is registered on another machine with the same username and password, is the license hex the same or different?

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
I don't know much about scripting. That is something I just pieced together from searching the internet. So I am not sure about the converting question. The hex is different on every computer I register the software to.

If I export the binary key to a text file, I get all the hex numbers.
 
For future reference, binary reg keys need to be hex not decimal.

As for the hex being different from computer to computer, it's probably hashed at the registration time. The only why I see of accomplishing what you want is visibly. :(

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
I dont know if this would be usefull for this projec but, years ago i found a tool called autoit is easy to use and i used to do several automated installations and even repetitive dataentry tasks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top