Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching a java class from a vbs file while excluding console window

Status
Not open for further replies.

mluken

Programmer
Dec 31, 2003
54
US
I have written a vbs file that launches a java class. The vbs file is set using windows scheduler so that it can be run every 10 minutes. My code looks like this:

Code:
Dim WSHShell, FSO, javaclass, cmdline

Set WSHShell = WScript.CreateObject("WScript.Shell")
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")

cmdline = "c:\j2sdk1.4.2_03\bin\java.exe -classpath c:\inetpub\jobs\lib\ DesktopPrintScreen"
   WSHShell.Run cmdline, 1, false

Set WSHShell = Nothing
Set FSO = Nothing
WScript.Quit(0)

This works fine, except that every 10 minutes it launches (briefly) a command window. Is there a way to launch this java file WITHOUT launching a console window? It is beginning to annoy me having that pop up every 10 minutes but I need the process to run! thoughts?

Thanks!
 
Hello mluken,

Replace intWindowsStyle from normal to hidden.
Code:
    WSHShell.Run cmdline, 0, false
regards - tsuji

ps Do you not realize this is off-topic for vb forum?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top