Solved

Windows Server 2012  Drive mapping through btach files not working

Posted on 2013-01-25
12
2,469 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 250 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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 54

Accepted Solution

by:
McKnife earned 250 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 54

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article will review the basic installation and configuration for Windows Software Update Services (WSUS) in a Windows 2012 R2 environment.  WSUS is a Microsoft tool that allows administrators to manage and control updates to be approved and ins…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

733 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