Subst drive invisible in non-admin processes












1














I have a local folder, X:SourceQ_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:SourceQ_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.










share|improve this question




















  • 1




    what you are seeing is no different than 7 or even Vista -- when you run something "As administrator" then it runs in the Administrator's context, and not the user's. Anyhow, what's the ACTUAL problem you're trying to solve? Why not just map/subst Q: as the current user?
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 17:51








  • 1




    With UAC on you get 2 contexts, the filtered standard user and the elevated user. The subst command is only effective for the context it was issued in. You would need to run the subst as standard user. What is the reason you run the shortcut as administrator?
    – David Marshall
    Jul 2 '13 at 17:53










  • @DavidMarshall I need that because most of my programs need to run as administrator - Visual Studio, Far Manager, etc. I try to run as few programs as admin as I can but that only applies to Office programs. I'm an engineer and most of my programs need to run as admin.
    – xxbbcc
    Jul 2 '13 at 17:56






  • 5




    Or subst it twice, once for the user context you're using, and once for the administrator user's context. PS: I run VS in regular user mode all the time - helps you from making programs that require Admin privileges without realizing it. ;) Perhaps you should consider changing your processes instead of trying to circumvent OS security.
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 18:02






  • 1




    Possible duplicate of Command Prompt in Administrator mode doesn't see mapped drives
    – Ben N
    Jul 17 '17 at 15:24
















1














I have a local folder, X:SourceQ_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:SourceQ_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.










share|improve this question




















  • 1




    what you are seeing is no different than 7 or even Vista -- when you run something "As administrator" then it runs in the Administrator's context, and not the user's. Anyhow, what's the ACTUAL problem you're trying to solve? Why not just map/subst Q: as the current user?
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 17:51








  • 1




    With UAC on you get 2 contexts, the filtered standard user and the elevated user. The subst command is only effective for the context it was issued in. You would need to run the subst as standard user. What is the reason you run the shortcut as administrator?
    – David Marshall
    Jul 2 '13 at 17:53










  • @DavidMarshall I need that because most of my programs need to run as administrator - Visual Studio, Far Manager, etc. I try to run as few programs as admin as I can but that only applies to Office programs. I'm an engineer and most of my programs need to run as admin.
    – xxbbcc
    Jul 2 '13 at 17:56






  • 5




    Or subst it twice, once for the user context you're using, and once for the administrator user's context. PS: I run VS in regular user mode all the time - helps you from making programs that require Admin privileges without realizing it. ;) Perhaps you should consider changing your processes instead of trying to circumvent OS security.
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 18:02






  • 1




    Possible duplicate of Command Prompt in Administrator mode doesn't see mapped drives
    – Ben N
    Jul 17 '17 at 15:24














1












1








1


1





I have a local folder, X:SourceQ_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:SourceQ_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.










share|improve this question















I have a local folder, X:SourceQ_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:SourceQ_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.







windows-8 subst






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 2 '13 at 17:46

























asked Jul 2 '13 at 17:29









xxbbcc

2001211




2001211








  • 1




    what you are seeing is no different than 7 or even Vista -- when you run something "As administrator" then it runs in the Administrator's context, and not the user's. Anyhow, what's the ACTUAL problem you're trying to solve? Why not just map/subst Q: as the current user?
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 17:51








  • 1




    With UAC on you get 2 contexts, the filtered standard user and the elevated user. The subst command is only effective for the context it was issued in. You would need to run the subst as standard user. What is the reason you run the shortcut as administrator?
    – David Marshall
    Jul 2 '13 at 17:53










  • @DavidMarshall I need that because most of my programs need to run as administrator - Visual Studio, Far Manager, etc. I try to run as few programs as admin as I can but that only applies to Office programs. I'm an engineer and most of my programs need to run as admin.
    – xxbbcc
    Jul 2 '13 at 17:56






  • 5




    Or subst it twice, once for the user context you're using, and once for the administrator user's context. PS: I run VS in regular user mode all the time - helps you from making programs that require Admin privileges without realizing it. ;) Perhaps you should consider changing your processes instead of trying to circumvent OS security.
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 18:02






  • 1




    Possible duplicate of Command Prompt in Administrator mode doesn't see mapped drives
    – Ben N
    Jul 17 '17 at 15:24














  • 1




    what you are seeing is no different than 7 or even Vista -- when you run something "As administrator" then it runs in the Administrator's context, and not the user's. Anyhow, what's the ACTUAL problem you're trying to solve? Why not just map/subst Q: as the current user?
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 17:51








  • 1




    With UAC on you get 2 contexts, the filtered standard user and the elevated user. The subst command is only effective for the context it was issued in. You would need to run the subst as standard user. What is the reason you run the shortcut as administrator?
    – David Marshall
    Jul 2 '13 at 17:53










  • @DavidMarshall I need that because most of my programs need to run as administrator - Visual Studio, Far Manager, etc. I try to run as few programs as admin as I can but that only applies to Office programs. I'm an engineer and most of my programs need to run as admin.
    – xxbbcc
    Jul 2 '13 at 17:56






  • 5




    Or subst it twice, once for the user context you're using, and once for the administrator user's context. PS: I run VS in regular user mode all the time - helps you from making programs that require Admin privileges without realizing it. ;) Perhaps you should consider changing your processes instead of trying to circumvent OS security.
    – Ƭᴇcʜιᴇ007
    Jul 2 '13 at 18:02






  • 1




    Possible duplicate of Command Prompt in Administrator mode doesn't see mapped drives
    – Ben N
    Jul 17 '17 at 15:24








1




1




what you are seeing is no different than 7 or even Vista -- when you run something "As administrator" then it runs in the Administrator's context, and not the user's. Anyhow, what's the ACTUAL problem you're trying to solve? Why not just map/subst Q: as the current user?
– Ƭᴇcʜιᴇ007
Jul 2 '13 at 17:51






what you are seeing is no different than 7 or even Vista -- when you run something "As administrator" then it runs in the Administrator's context, and not the user's. Anyhow, what's the ACTUAL problem you're trying to solve? Why not just map/subst Q: as the current user?
– Ƭᴇcʜιᴇ007
Jul 2 '13 at 17:51






1




1




With UAC on you get 2 contexts, the filtered standard user and the elevated user. The subst command is only effective for the context it was issued in. You would need to run the subst as standard user. What is the reason you run the shortcut as administrator?
– David Marshall
Jul 2 '13 at 17:53




With UAC on you get 2 contexts, the filtered standard user and the elevated user. The subst command is only effective for the context it was issued in. You would need to run the subst as standard user. What is the reason you run the shortcut as administrator?
– David Marshall
Jul 2 '13 at 17:53












@DavidMarshall I need that because most of my programs need to run as administrator - Visual Studio, Far Manager, etc. I try to run as few programs as admin as I can but that only applies to Office programs. I'm an engineer and most of my programs need to run as admin.
– xxbbcc
Jul 2 '13 at 17:56




@DavidMarshall I need that because most of my programs need to run as administrator - Visual Studio, Far Manager, etc. I try to run as few programs as admin as I can but that only applies to Office programs. I'm an engineer and most of my programs need to run as admin.
– xxbbcc
Jul 2 '13 at 17:56




5




5




Or subst it twice, once for the user context you're using, and once for the administrator user's context. PS: I run VS in regular user mode all the time - helps you from making programs that require Admin privileges without realizing it. ;) Perhaps you should consider changing your processes instead of trying to circumvent OS security.
– Ƭᴇcʜιᴇ007
Jul 2 '13 at 18:02




Or subst it twice, once for the user context you're using, and once for the administrator user's context. PS: I run VS in regular user mode all the time - helps you from making programs that require Admin privileges without realizing it. ;) Perhaps you should consider changing your processes instead of trying to circumvent OS security.
– Ƭᴇcʜιᴇ007
Jul 2 '13 at 18:02




1




1




Possible duplicate of Command Prompt in Administrator mode doesn't see mapped drives
– Ben N
Jul 17 '17 at 15:24




Possible duplicate of Command Prompt in Administrator mode doesn't see mapped drives
– Ben N
Jul 17 '17 at 15:24










1 Answer
1






active

oldest

votes


















0














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..."






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f614721%2fsubst-drive-invisible-in-non-admin-processes%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    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..."






    share|improve this answer




























      0














      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..."






      share|improve this answer


























        0












        0








        0






        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..."






        share|improve this 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..."







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 30 '15 at 10:20

























        answered Jul 7 '15 at 7:28









        user244257

        314




        314






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f614721%2fsubst-drive-invisible-in-non-admin-processes%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy