Solved

Mapping a Specific Drive with a RemoteApp

Posted on 2014-04-11
4
266 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:peppele
  • 2
4 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
Comment Utility
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 23

Expert Comment

by:Coralon
Comment Utility
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:peppele
Comment Utility
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 23

Accepted Solution

by:
Coralon earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now