WinBatch® Technical Support Forum

All Things WinBatch => WebBatch => Topic started by: mhall on December 30, 2015, 07:51:24 AM

Title: Another Apache/Webbatch question
Post by: mhall on December 30, 2015, 07:51:24 AM
Hi All,

OK, so I've been working through the night to update my configuration and get things working here on my transition to Apache. And, largely, they are working well.

However, I've run into one gotcha that, from a security standpoint, makes sense, but that I need to get rid of. I need to be able to allow Webbatch to launch other programs as the local user account interactively.

The reason is that this is an internal site, run on my own local machine and is actually the hub for my activities. Currently, running on Sambar, I can use run() in Webbatch to, for example, launch notepad and open a text file. Or I can open a file in Photoshop, or move files on disk. Essentially, the browser has become my interface for nearly everything and I use Webbatch in the background to launch applications, etc. I can use the COM controls built into Webbatch to control Photoshop and generate output.

It's a feature I've really come to rely on and I'm hoping I can configure things with Apache similarly. Right now the programs will launch via Webbatch, but they are running as background processes and I can't interact with them. As a simple test, I have my site set to run notepad I can see multiple instances of notepad running in the task manager, but the only thing I can do is terminate them! My image viewer program starts, but again is running in a non-interactive fashion.

I've tried changing the Apache service settings so that the Log On includes "Allow Interaction with Desktop". I've tried assigning the Service to run using an elevated account as well as running Apache from a shortcut with elevated privileges. I've also tried various different run commands ... runShell() runWithLogin(), etc. But it all still runs as a background process - I'm assuming that's being inherited from the Apache process.

Any ideas of how I could launch a program via Webbatch in an interactive mode?

~Micheal

Title: Re: Another Apache/Webbatch question
Post by: td on December 30, 2015, 10:43:53 AM
Setting a service to "Allow Interaction with Desktop" does not allow the service to interact with the desktop.  IIRC, it simply allows the service to interact with a virtual desktop which is not seen by the user.  As MFT states, "Services cannot directly interact with a user as of Windows Vista."  There are several Rube Goldbergian ways to workaround this problem that involve the terminal service extender and /or a desktop background process that can detect and execute requests made by the service.
Title: Re: Another Apache/Webbatch question
Post by: mhall on December 30, 2015, 04:01:57 PM
Thanks Tony.

So it looks like I need to run not as a service and it turns out that's pretty easy to do. RunHide comes in handy here to tuck the console window away where I don't see it. :)

~Micheal
Title: Re: Another Apache/Webbatch question
Post by: td on December 31, 2015, 07:25:45 AM
Good choice.