Jump to content

Recommended Posts

Posted

Hi,

Forgive my ignorance but I'm new to VBS and was hoping someone might be able to tell me where I'm going wrong with the below portion of a script I'm writing:

Const HKEY_LOCAL_MACHINE = &H80000002

'Variables
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """\\closepf.local\dfs\packages\JAVA\epal.exe"" ""/c:ou=JRE,ou=EPAL Groups,ou=Exempt Users and Groups,ou=Closepf Users"" ""\\closepf.local\dfs\packages\JAVA\jre-6u10.exe"" & "/s /v/qn IEXPLORER=1 REBOOT=Suppress"""

The script runs EPAL to launch an install of Java Runtime Environment onto users PCs that do not have admin rights.

The syntax is correct (without the required VBS quotes) because I can run it from either a command window or Start-Run but I cannot get it to execute as a VBS script, I get an expected end of statement error on line 8, column 198.

Any help would be much appreciated.


Posted

<Edit>

Content removed because due to my lack of information it was beginning to confuse me!

Can you simply confirm that these are the two exact command lines you need to run!

Please test them first to ensure that they work properly and also please make sure that they do not need to run under the command interpreter.




\\closepf.local\dfs\packages\JAVA\epal.exe /C:ou=JRE,ou="EPAL Groups",ou="Exempt Users and Groups",ou="Closepf Users"


\\closepf.local\dfs\packages\JAVA\jre-6u10.exe /s /v/qn IEXPLORER=1 REBOOT=Suppress

If the above is correct then something like this should be what you're looking for

Option Explicit

Dim strPkgs, strEpal, strJRE, objShell

strPkgs = "\\closepf.local\dfs\packages\JAVA"
strEpal = strPkgs & "\epal.exe /C:ou=JRE,ou=""EPAL Groups""," _
& "ou=""Exempt Users and Groups"",ou=""Closepf Users"""
strJRE = strPkgs & "\jre-6u10.exe /s /v/qn IEXPLORER=1 REBOOT=Suppress"

Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run strEpal, 0, True
objShell.Run strJRE, 0, True

Set objShell = Nothing

</Edit>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...