/build/static/layout/Breadcrumb_cap_w.png

vbscript custom action

Hi,

Option Explicit
Dim strPath
Dim objshell
Dim iwordwrap

strPath="HKCU\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\{601ED020-FB6C-11D3-87D8-0050DA59922B}\Flags"
Set objSHell=CreateObject("WScript.Shell")
iWordWrap = objShell.RegRead(strPath)

objShell.RegWrite strPath, 1, "REG_DWORD"



This appears to be the "Set objShell= CreateObject("Wscript.Shell")" line.

Any help would be appreciated

Thanks

0 Comments   [ + ] Show comments

Answers (7)

Posted by: Secondlaw 15 years ago
Third Degree Blue Belt
0
Nevermind... guess putting "End" at the end would have helped. :)
Posted by: Secondlaw 15 years ago
Third Degree Blue Belt
0
Ok, I guess that wasn't it afterall.

Anyone have any ideas?
Posted by: McRip 15 years ago
Orange Senior Belt
0
Here is all you need for creating the key, writing a string value anda dword value via vbscript.

Just modifiy the path you need...


Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
Const HKEY_DYN_DATA = &H80000006

strComputer = "."
Set StdOut = WScript.StdOut

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

strKeyPath = "SOFTWARE\Test"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

strKeyPath = "SOFTWARE\Test"
strValueName = "This is a Test"
strValue = "testfolder"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName = "Testing"
dwValue = 82
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue


Cheers
Posted by: Secondlaw 15 years ago
Third Degree Blue Belt
0
Excellent! Thank you.
Posted by: anonymous_9363 15 years ago
Red Belt
0
Why resort to script when you could have used the Registry table?!?
Posted by: kiptek 15 years ago
Second Degree Green Belt
0
Yep. And when dealing with IE Add-ons there's that pesky per user problem. How are you making sure the CA runs for all users when they log in? Like Ian said, use the reg table & let WI do the rest for you...
Posted by: Secondlaw 15 years ago
Third Degree Blue Belt
0
I think I have a good reason for this but I could be mistaken...

Once my software is installed, I open IE and the addin is enabled. 0 typically means off and 1 typically means on. However, with addins it's opposite... 1 is off and 0 is on. Go figure. So, I have used the registry table to give this value a 1. Now my script is working and the BHO is no longer an option in the IE addins section. The only issue I'm having is with this damned .dll being held hostage as you can see in my other thread... (Probably should have just added that stuff to this thread.)

That being said, this portion of the script is now working flawlessly.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ