Solved

Windows Server 2012  Drive mapping through btach files not working

Posted on 2013-01-25
12
2,417 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
  • 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Understanding the various editions available is vital when you decide to purchase Windows Server 2012. You need to have a basic understanding of the features and limitations in each edition in order to make a well-informed decision that best suits y…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

803 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