Using Batch Scripts To Silently Load Applications Before Main Application Starts On XenApp Published App

Hey All -

I'm currently working on an issue that I have a couple of questions about.  I have a XenApp server that hosts a program called GulfPak.  In that application, one feature is to click a button toi launch an email with forms attached.  To get this to work, we have published a batch file instead of the GulfPak executable so that we may map a couple of drives and launch Microsoft Online SignIn Assistant which will automatically configure the current user's email in their roaming profile on the XenApp server.  The user's machines have the applications published, not the desktop so I'm trying to make a few things as silent as possible

The issue that i'm running into is that when they launch the GulfPak application, the batch files runs (as it's supposed to) but it shows the Microsoft Sign-In Assistant and black command windows before getting to GulfPak.  Also - if they exit out of GulfPak and get back into it, since MS Signin is already running on the server (because they are in the same session) it pops up again no matter what when the batch file is run.

I've tried many different switches in the batch files, but can't get it  to work 100%.  Here's my current batch file:

@echo off
net use i: \\xxxxxx001\gpsuite
start /min "C:\Program Files\Microsoft Online Services\Sign In\SignIn.exe"

The only other issues I'm having is that when running the script above, a new command window appears minimized on the taskbar (screenshot 1) and sometimes (on the client workstation) there's a balloon notification in the system tray saying that MS Sign-In is "Running in Minimized" or something similar.

One more note...  Only about 5 users will require this configuration.  If it was different, then I'd run it globally or have MS SignIn always on for all users, but can only have it running for a few.

I hope that this was easy enough to understand.  Please let me know what you suggest as I have to get this going today.


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The main error is that signin.exe is actually never started.
If quotes are required around the program path when using "start", the "title" parameter is required as well.
In other words, try

start "" /min "%ProgramFiles%\Microsoft Online Services\Sign In\SignIn.exe"

(Note the empty pair of quotes after "start"!)
To prevent signin.exe from starting if it's running already, you can check the tasklist:

@echo off
REM make sure I: is mapped to the correct drive:
if exist I: net use I: /delete
net use I: \\xxxxxx001\gpsuite
REM check if signin.exe is running already:
tasklist /FI "USERNAME eq %Username%" | find /i "signin.exe"
if errorlevel 1 (
  start "" /min "%ProgramFiles%\Microsoft Online Services\Sign In\SignIn.exe"

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BzowKAuthor Commented:
Thank you very much for your suggestion.

One question, though - Since it's running on a XenApp server, many users use the same program at once.  In Task Manager when all users is checked, there may be up to about 5-10 signon.exe instances.  Does it check the complete task list or just the current users?  i'm assuming just the users bacause of the "USERNAME eq %Username%" line.

Should this prevent the extra empty command dialogue from opening too?

The tasklist command will only query the current user's session.
The empty command window was coming from the "start" command; simply try it: enter
start "calc.exe"
A command window with the title "calc.exe" will open, not the calculator.
Now enter
start "" "calc.exe"
and it will work.
BzowKAuthor Commented:
This batch script worked perfectly (...knock on wood :)...).  Thank you very much for taking the time to write it up and help.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.