Jump to content

Calling 2 executables with switches


cahonis

Recommended Posts

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 (MS Elevated Priveleges Application Launcher) 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.

Link to comment
Share on other sites

For the coding I have used cmd prompt to do more than one task sequentiallyeg change the code so that there is && between the two comands such as (simplified example)calc && notepad && cmd

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...