B4J Question jShell - Hide app - background process...

Magma

Expert
Licensed User
Longtime User
Hi there..

old days with vbscript + vb6 have the option to hide (not minimized - hide) something we want "running" at background... can we do that with jShell too.. somehow ...

old vbscript was something like that:
B4X:
Dim WShell
Set WShell = CreateObject("WScript.Shell")
WShell.Run "Notepad.exe", 0
Set WShell = Nothing

any solution to that ?
 

KMatle

Expert
Licensed User
Longtime User
I call my vbs scripts like this to run without showing anything:

B4X:
Dim GetMailsSh As Shell
GetMailsSh.Initialize("GetMails", "c:\windows\system32\cscript.exe", Array As String("//nologo", File.DirApp & "\" & WorkingDir& "\GetMailsUTF8.vbs",AccountName,MarkAsRead,RemoveDoubleCRLFsInBody))
GetMailsSh.WorkingDirectory = File.DirApp &  "\" & WorkingDir
GetMailsSh.Run(120000)

WScript.echo is "routed" to StdOut

B4X:
GetMails_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Log(StdOut)
Log(StdErr)
...
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
@KMatle ...yes i know this is a way to run vbs script... my problem isn't running scripts...
but how to hide (specific example the command into script: WShell.Run "Notepad.exe", 0) the background process/or foreground window from jShelll or a javaobject native shell...
For the example: Actually Run Notepad.exe without window Foreground - so is that possible with jShell or any other Javaobject command / library ?

Thanks in advance !!!

ps: i know that a solution can be if i put the exe apps running from scripts... but I need middleware (cscript).. i need to have it direct... other way I can do that with powershell too... but will be better direct!
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
I think it's app specific -> how the app is designed. Acrobat has a switch to run without a window (e.g. to print). 7Zip (which I use often), too. To be honest: I don't get exactly what you need. Maybe it's better to describe what the goal is.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
My goal is to hide totally an app "showing" in taskbar ... actually set it's "Started/WindowStyle" property to be hidden :) --- But in general speaking you are right because if there is no switch at the app or no console app - it is not legal too....

i am gonna talk to the developer of utility i need to use it at my app... may be credits are enough... or a donation...
 
Upvote 0
Top