Const HKEY_LOCAL_MACHINE = &H80000002 dim filesys, system32 Set filesys = CreateObject("Scripting.FileSystemObject") Set system32 = filesys.GetSpecialFolder(1) Const PROGRAM_FILES = &H26& Dim objShell, objFolder, objFolderItem Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(PROGRAM_FILES) Set objFolderItem = objFolder.Self ProgramFiles = objFolderItem.Path source_file = ProgramFiles & "\PBZ\LogosPkcs11JNI-1.0.jar" strValueName = "JavaHome" strComputer = "." Set objRegistry = GetObject("winmgmts:\\" & _ strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\JavaSoft\Java Runtime Environment\" Const OverwriteExisting = True Set objFSO = CreateObject("Scripting.FileSystemObject") objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys If IsArray(arrSubKeys) Then For Each subkey In arrSubKeys strFullKey = strKeyPath & subkey objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strFullKey,strValueName,strValue If Not(IsNull(strValue)) Then objFSO.CopyFile source_file , strValue & "\lib\ext\", OverwriteExisting End If Next End If Wscript.Echo "Nadogradnja uspješno završena!"