/build/static/layout/Breadcrumb_cap_w.png

VB SCRIPT FOR JAVA APPLICATION

I would kindly appreciate it if anyone can help this scripting issue


I have this java app that needs a vb script to resolve a run time error


the script should read the registry key under hklm\ xxx\xxxx

then write the value and store in a variable

then install the java app with the /q:a /r:n arguments

then write the value in the variable back into the reg key to install the app

any leads would be higly appreciated

0 Comments   [ + ] Show comments

Answers (5)

Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
So what you want is a MSI package that installs the java app? And within this MSI package it records an existing registry key value, and then after installation it writes this registry key back again?

I don't mind helping you write the script, but can you elaborate on the requirements please?
Posted by: cygan 18 years ago
Fifth Degree Brown Belt
0
1) read the registry value from [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing]
"Policy"=hex:00,00 before install

2) store value in a variable then write the new value ( value change)

3) install the java.exe with the arguments /q:a ( space) /r:n

4) write the original value in the variable back into the reg key



yes thanks that is my problem. I would be grateful if you can possible help
are there any specific requirements I need to give
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
This is depends on your actual requirements, but here is a vbscript that should be able to do what you want:


CONST HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\Microsoft\Driver Signing"
strValueName = "Policy"

'Read the regsitry key value into the intRegKeyOriginalValue variable.
Set objWMIReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
objWMIReg.GetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, intRegKeyOriginalValue
Set objWMIReg = Nothing

'Write the new registry key value.
intRegKeyTemporaryValue = Array(&H00000000, &H00000001)
Set objWMIReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
objWMIReg.SetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, intRegKeyTemporaryValue
set objWMIReg = Nothing

'Install the java application.
objShell.Run "C:\Windows\Temp\Java.exe /q:a /r:n", , TRUE

'Write the original registry key back.
Set objWMIReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
objWMIReg.SetBinaryValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, intRegKeyOriginalValue
set objWMIReg = Nothing
Posted by: brenthunter2005 18 years ago
Fifth Degree Brown Belt
0
Whoops, forgot to tell you to change the following line to suit your needs:

intRegKeyTemporaryValue = Array(&H00000000, &H00000001)

eg: To set the binary registry key to 60:01:4a, the line would read:
intRegKeyTemporaryValue = Array(&H00000060, &H00000001, &H0000004A)


And this line objShell.Run "C:\Windows\Temp\Java.exe /q:a /r:n", , TRUE to run your Java app installation.
Posted by: cygan 18 years ago
Fifth Degree Brown Belt
0
thanks will go through it
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