/home/wpollock1/public_html/restricted/ShellScripting/ExeBits.vbs

Rem This (VB) script displays runs the executable Java Jar file
Rem named ExeBits.jar (in the same folder), passing it any arguments
Rem (for example, if files are dragged and dropped  on this).

Rem Written 2017 by Wayne Pollock, Tampa Florida USA

Dim wshShell, currentDirectory
Set wshShell = WScript.CreateObject("WScript.Shell")

args = ""
For i = 0 To WScript.Arguments.Count-1
  args = args & " """ & WScript.Arguments(i) & """"
Next

Rem Determine if launched from command line or from GUI:
Set objEnv = WshShell.Environment("Process")
If InStr(1, objenv("PROMPT"), "$P$G", vbTextCompare) Then
    cmd = "java.exe"
Else
    cmd = "javaw.exe"
End If

cwd = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
wshShell.Run "cmd /c javaw.exe -jar """ & cwd & "\ExeBits.jar"" " & args, 0, True