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
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)
Please log in to answer
Posted by:
brenthunter2005
18 years ago
Posted by:
cygan
18 years ago
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
"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
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
Whoops, forgot to tell you to change the following line to suit your needs:
eg: To set the binary registry key to 60:01:4a, the line would read:
And this line
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.