Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Windows Server 2012  Drive mapping through btach files not working

Posted on 2013-01-25
12
Medium Priority
?
2,614 Views
Last Modified: 2013-01-28
Hi All,

I used to have a batch file that uses the subst command to map a local drive for use by a particular program. The batch file worked in Windows server 2003 and server 2008.

The file name = DriveMap.BAT
Contents = SUBST W: C:\Gippro\WP\%Username%

The scenario is

The user logs on to the terminal server using Remote Desktop and upon connection it auto opens the program (This is through the programs tab of the RDP client)
The batch file then kicks in and maps the drive (The batch file is placed in the startup folder )

However, This does not work on Windows server 2012.

Any ideas on how to get this working ?

P.S. - I have tried Group Policy Preferences for mapping drives without any luck. Would anyone know how to map a local drive (not a network drive) through GPP ?

Thank you in advance for any assistance

Meperera
0
Comment
Question by:meperera
[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
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 17

Expert Comment

by:Nik
ID: 38817885
Have you tried to disable UAC?
0
 
LVL 37

Assisted Solution

by:Neil Russell
Neil Russell earned 1000 total points
ID: 38817943
Try setting the Location in the GPP to

\\%ComputerName%\c$\Gippro\WP\%USERNAME%

Of course the user would need access to the C$ share on the local PC or you could create a share on each machine that needs to do this called WP and then use

\\%ComputerName%\WP\%USERNAME%
0
 

Author Comment

by:meperera
ID: 38818201
Thanks for the responses. Yes I have tried disabling UAC.

Neilsr - if I do the mapping this way wouldn't it map as a network drive instead of a local drive ?
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 37

Expert Comment

by:Neil Russell
ID: 38819836
It will map it as the w: drive and thats what you need isnt it?
0
 

Author Comment

by:meperera
ID: 38820871
It needs to be mapped as a local drive ( this was previously mapped with SUBST not NET USE)
0
 
LVL 56

Accepted Solution

by:
McKnife earned 1000 total points
ID: 38822363
> However, This does not work on Windows server 2012.
Would you be so kind to tell us what is happening? You know that you can always have the batch log into a logfile using >>somelogatsomelocation.txt at the end of each line.
Subst should work.

I have read that people are experiencing bugs in windows 8's GPPs when it comes to mapping network drives. Maybe the same for win2012 (same code base as win8).
See http://www.windowsitpro.com/article/windowsserver2012/group-policy-drive-mapping-windows-8-144591 for a solution.
0
 

Author Comment

by:meperera
ID: 38823417
Thanks for that.. I had already tried that link with no luck..

The bottom line is that the batch files don't run unless explorer is kicked off.
0
 
LVL 56

Expert Comment

by:McKnife
ID: 38824244
The batch files run with or without. The out coming result changes after explorer.exe is kicked and restarted - is that what you are trying to say? Please have the batch log to a file and recite that file here.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38824334
"It needs to be mapped as a local drive ( this was previously mapped with SUBST not NET USE) "

And the difference to your application? Does it know that there is a difference or just look for the W: drive?
0
 

Author Comment

by:meperera
ID: 38826041
The batch files run with or without. The out coming result changes after explorer.exe is kicked and restarted - is that what you are trying to say? Please have the batch log to a file and recite that file here

The batch file does not get processed before eplorer.exe is not started and therefore the log file empty.

And the difference to your application? Does it know that there is a difference or just look for the W: drive?

Yes it is used for Word processing merge file refereneces and therefore there is a difference as to whether the drives is mapped locally or as network drive.
0
 

Author Comment

by:meperera
ID: 38826046
Hi guys,

Thanks for all your responses. Due to the urgency of the matter I have come up with a workaround that basically opens the application through an explictly called batch file. The drive mapping is done as a part of the batch file.

The difference in this batch file is that unlike statup batch files this can called from the programs tab in the RDP client connection.

Sean P
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 38828146
"Yes it is used for Word processing merge file refereneces and therefore there is a difference as to whether the drives is mapped locally or as network drive."

If your merge references the W: drive path then it will not matter at all if it is a network or local drive map
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
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 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…

636 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