Link to home
Start Free TrialLog in
Avatar of Lee Pepper
Lee PepperFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Mapping a Specific Drive with a RemoteApp

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.
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Wouldn't the easiest thing to do is use separate mapped drives for each instance of yourapp i.e. yourapp-company1 and yourapp-company2
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
Avatar of Lee Pepper

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Coralon
Coralon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial