Solved

Mapping a Specific Drive with a RemoteApp

Posted on 2014-04-11
4
345 Views
Last Modified: 2014-08-07
Hi, we have a remoteapp (windows 2008 R2) that users have on their desktop. As expected users click the remoteapp rdp icon and the app opens seamlessly on their PC desktop.

The app comes in two flavours (one for company A and one for company B) and both apps require the O drive to be mapped on the terminal server profile itself (not locally but on the terminal server session / profile), but for company A the O maps to share \share_one and for company B the O drive needs to map to \share_two. Basically O drive but different share names. It's all to do with how the application works and this cant be changed.

The problem we have is that if a user needs to use both apps, when she clicks the second one the O drive is still mapped to the old mapping and the second program errors.

Is there a good way to get a remoteapp to map a drive on the TS before it runs the program. So that if the user (who will still be logged on to the terminal server) comes out, clicks the second app will then get the correct drive re-mapped?

I understand about redirecting drives amd GPOs but that doesn't give the ability to map a specific drive each time a remoteapp is run.
0
Comment
Question by:Lee Pepper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 39995646
Wouldn't the easiest thing to do is use separate mapped drives for each instance of yourapp i.e. yourapp-company1 and yourapp-company2
0
 
LVL 25

Expert Comment

by:Coralon
ID: 39995691
It depends on how you determine who runs which version.
But, ultimately, you'll want to use some sort of wrapper script for your remote app.

I can think of several different ways to handle this based on who is doing what, and they all tie into using a script to do this, and what your security requirements are.

As an example batch file:
@echo off

:Begin
if exist o:\nul net use o: /d
if exist o:\nul subst i: /d

choice /c ABQ /m "Press A for Company A, Press B for Company B, Press Q to quit"
if %ERRORLEVEL% == 3 goto Quit
if %ERRORLEVEL% == 2 goto CompanyB

:CompanyA
net use o: \\server\share1
call "<path>\myapp.exe"

goto Begin

:CompanyB
net use o: \\server\share2
call "<path>\myapp.exe"

goto Begin

:Quit

Open in new window


You would publish your app as cmd.exe /c wrapperscript.cmd

It's also easy to write similar things in any number of scripting languages.  If your users need to be locked down to a single version, you'd publish 3 copies of your app.. one for Company A, one for Company B, and one that gives them the choice.

The key is forcing to map the o: drive immediately before launching the application.

Coralon
0
 

Author Comment

by:Lee Pepper
ID: 39998673
Thank you for this Coralon!

On the RemoteApp Manager program, you have to specify both a path and then arguments. When I come to call the application from the script, how do I add those arguments in.

So for example, on our app there is:

Path: D:\application\application.exe
Arguments: "D:\application\application.exe" =baskey "INI" -ininame etc etc and it goes on for a bit....

Thanks
0
 
LVL 25

Accepted Solution

by:
Coralon earned 500 total points
ID: 40000528
You would just modify the command lines where they are called.  

On each of those CALL lines, you will put the full path for each command.
call d:\application.exe =baskey "INI" -ininame ....

Open in new window


If this works for you, then great, if not, I can put something else together easily enough.. there are *tons* of ways to do this in a wrapper script.  

And always glad to help!

Coralon
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let’s list some of the technologies that enable smooth teleworking. 
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question