Solved

Windows Server 2012  Drive mapping through btach files not working

Posted on 2013-01-25
12
2,514 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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 
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 55

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 55

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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

705 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