Solved

Windows Server 2012  Drive mapping through btach files not working

Posted on 2013-01-25
12
2,363 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
 
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 53

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 53

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

OfficeMate Freezes on login or does not load after login credentials are input.
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 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 the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

707 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

12 Experts available now in Live!

Get 1:1 Help Now