cahonis Posted November 4, 2008 Posted November 4, 2008 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'VariablesstrComputer = "."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.
Yzöwl Posted November 4, 2008 Posted November 4, 2008 <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=SuppressIf the above is correct then something like this should be what you're looking forOption ExplicitDim strPkgs, strEpal, strJRE, objShellstrPkgs = "\\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, TrueobjShell.Run strJRE, 0, TrueSet objShell = Nothing</Edit>
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now