Could I add multiple reg key changes to this vbs? I would have to define a new sPath at the end right?
-Devon -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Almeida Pinto, Jorge de Sent: Friday, October 14, 2005 5:51 PM To: ActiveDir@mail.activedir.org; ActiveDir@mail.activedir.org Subject: RE: [ActiveDir] Kix to VBS Hi, Try the following: Cheers, jorge 'http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk /wmi/enumvalues_method_in_class_stdregprov.asp ########################### Const HKCU = &H80000001 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\defau lt:StdRegProv") sPath = "Software\IXOS" On Error Resume Next sKeyExist = False oReg.EnumKey HKCU, sPath, arrSubKeys For Each sSubKey In arrSubKeys If UCase(sSubKey) = "IXOS_ARCHIVE" Then sKeyExist = True Exit For End If Next Set sSubKey = Nothing Set arrSubKeys = Nothing If sKeyExist = True Then sPath = "Software\IXOS\IXOS_ARCHIVE\Viewer\Printing" On Error Resume Next oReg.EnumKey HKCU, sPath, arrSubKeys sKeyExist = False For Each sSubKey In arrSubKeys If UCase(sSubKey) = "FAX" Then sKeyExist = True Exit For End If Next Set sSubKey = Nothing Set arrSubKeys = Nothing If sKeyExist = False Then oReg.CreateKey HKCU, sPath & "\FAX" oReg.SetDWORDValue HKCU, sPath & "\FAX", "PaperSize", 1 Else On Error Resume Next oReg.EnumValue HKCU, sPath, arrValueNames, arrValueTypes sValueExist = False For Each sValue In arrValueNames If sValue = "PaperSize" Then sValueExist = True Exit For End If Next Set sValue = Nothing Set arrValueNames = Nothing Set arrValueTypes = Nothing If sValueExist = True Then oReg.GetDWORDValue HKCU, sPath & "\FAX", "PaperSize", MYValueData If MYValueData <> "1" Then oReg.SetDWORDValue HKCU, sPath & "\FAX", "PaperSize", 1 End If Else oReg.SetDWORDValue HKCU, sPath & "\FAX", "PaperSize", 1 End If End If End If ########################### ________________________________ From: [EMAIL PROTECTED] on behalf of Harding, Devon Sent: Fri 10/14/2005 7:48 PM To: ActiveDir@mail.activedir.org Subject: [ActiveDir] Kix to VBS I'm having a tough time converting this kix script to ..vbs. Any Ideas? ; This change will fix an IXOS problem where the default paper size is A4 instead of Letter If KeyExist("HKCU\Software\IXOS\IXOS_ARCHIVE") = 1 If KeyExist("HKCU\Software\IXOS\IXOS_ARCHIVE\Viewer\Printing\FAX") = 0 AddKey("HKCU\Software\IXOS\IXOS_ARCHIVE\Viewer\Printing\FAX") EndIf If ReadValue("HKCU\Software\IXOS\IXOS_ARCHIVE\Viewer\Printing\FAX","PaperSi ze") <> 1 WriteValue("HKCU\Software\IXOS\IXOS_ARCHIVE\Viewer\Printing\FAX","PaperS ize","1","reg_dword") EndIf EndIf Devon Harding Windows Systems Engineer Southern Wine & Spirits - BSG 954-602-2469 ________________________________ __________________________________ This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use or distribution of the information included in the message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank You. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/