Windows – Subst drive invisible in non-admin processes

substwindows 8

I have a local folder, X:\Source\Q_Project that I want to map to the Q: drive letter. I use a shortcut that points to a batch file for this. The batch file is:

@echo off
subst q: /d
subst q: X:\Source\Q_Project

This worked just fine in Windows 7 Ultimate 64-bit – I was able to see the Q: drive from Windows Explorer and from any other 32/64-bit program, including the console, etc.

Under Windows 8 Home 64-bit, this no longer works. I have UAC off (only through the UI so it's not really, really off but warnings are off anyway). The shortcut is set to run as administrator under the Properties->Shortcut tab.

When I double-click the shortcut, the batch file executes and the Q: drive is visible from one particular program, Far Manager (32-bit console application, running as administrator). If I launch a process through Far Manager, that process also sees the Q: drive. Anything that I try to launch through File Explorer or other desktop shortcuts don't see the subst'd drive. If I run a shortcut with Run as administrator, those programs will see the Q: drive.

This is driving me crazy – is there a way to fix this in this sorry excuse of an OS? Windows 7 worked perfectly with this (I was running as an actual admin under Windows 7 but under Windows 8 I'm trying to see if it's possible to do it 'right' – so far this seems to fail, I keep having to run everything as an admin).

Is the only option to truly turn off UAC and run as an actual admin? I know it'll kill all Metro apps but that's fine by me.

Note: a permanent mapping through the registry won't work for me (I have one of those, too). I need to be able to re-map the Q: drive frequently to different source code repositories without having to log off / restart.

Best Answer

If you want to "map" the folders with subst and use an "administrator instance" of a program, you must do the "subst" as administrator too. Easy ;)

Right clic on your ShortCut and clic on "Run as Admin..."

Related Question