How do I pass the password to a net use command without being prompted?











up vote
1
down vote

favorite












I need to map a drive without being prompted for the password. I am trying to use net use and putting the password inline within the command. I get an error.



net use H: \MYSERVERMYFOLDERSBackup /user:ABCCompanyJoeUser oasddkjkla


I get the following error: 'sddkj' is not recognized as an internal or external command. If it's not obvious, it's a part of the password that I entered.



The command works fine if I remove the password and enter it upon the dialog box. I'm using Windows 10. Is it still acceptable to pass the password right after the username?










share|improve this question


















  • 1




    The command above looks correct to me. when writing your batch file, what program did you use?
    – Stese
    May 14 at 14:54










  • As I read the documentation, the password should follow the network share address.
    – AFH
    May 14 at 15:34










  • @Stese I used both the command window and a SQL Server cmd call. Both returned the same error.
    – Bill Greer
    May 14 at 16:13










  • @AFH Can you point me to the documentation you read?
    – Bill Greer
    May 14 at 16:14










  • Type net use /?. or look here.
    – AFH
    May 14 at 17:04















up vote
1
down vote

favorite












I need to map a drive without being prompted for the password. I am trying to use net use and putting the password inline within the command. I get an error.



net use H: \MYSERVERMYFOLDERSBackup /user:ABCCompanyJoeUser oasddkjkla


I get the following error: 'sddkj' is not recognized as an internal or external command. If it's not obvious, it's a part of the password that I entered.



The command works fine if I remove the password and enter it upon the dialog box. I'm using Windows 10. Is it still acceptable to pass the password right after the username?










share|improve this question


















  • 1




    The command above looks correct to me. when writing your batch file, what program did you use?
    – Stese
    May 14 at 14:54










  • As I read the documentation, the password should follow the network share address.
    – AFH
    May 14 at 15:34










  • @Stese I used both the command window and a SQL Server cmd call. Both returned the same error.
    – Bill Greer
    May 14 at 16:13










  • @AFH Can you point me to the documentation you read?
    – Bill Greer
    May 14 at 16:14










  • Type net use /?. or look here.
    – AFH
    May 14 at 17:04













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I need to map a drive without being prompted for the password. I am trying to use net use and putting the password inline within the command. I get an error.



net use H: \MYSERVERMYFOLDERSBackup /user:ABCCompanyJoeUser oasddkjkla


I get the following error: 'sddkj' is not recognized as an internal or external command. If it's not obvious, it's a part of the password that I entered.



The command works fine if I remove the password and enter it upon the dialog box. I'm using Windows 10. Is it still acceptable to pass the password right after the username?










share|improve this question













I need to map a drive without being prompted for the password. I am trying to use net use and putting the password inline within the command. I get an error.



net use H: \MYSERVERMYFOLDERSBackup /user:ABCCompanyJoeUser oasddkjkla


I get the following error: 'sddkj' is not recognized as an internal or external command. If it's not obvious, it's a part of the password that I entered.



The command works fine if I remove the password and enter it upon the dialog box. I'm using Windows 10. Is it still acceptable to pass the password right after the username?







command-line passwords






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 14 at 14:44









Bill Greer

10816




10816








  • 1




    The command above looks correct to me. when writing your batch file, what program did you use?
    – Stese
    May 14 at 14:54










  • As I read the documentation, the password should follow the network share address.
    – AFH
    May 14 at 15:34










  • @Stese I used both the command window and a SQL Server cmd call. Both returned the same error.
    – Bill Greer
    May 14 at 16:13










  • @AFH Can you point me to the documentation you read?
    – Bill Greer
    May 14 at 16:14










  • Type net use /?. or look here.
    – AFH
    May 14 at 17:04














  • 1




    The command above looks correct to me. when writing your batch file, what program did you use?
    – Stese
    May 14 at 14:54










  • As I read the documentation, the password should follow the network share address.
    – AFH
    May 14 at 15:34










  • @Stese I used both the command window and a SQL Server cmd call. Both returned the same error.
    – Bill Greer
    May 14 at 16:13










  • @AFH Can you point me to the documentation you read?
    – Bill Greer
    May 14 at 16:14










  • Type net use /?. or look here.
    – AFH
    May 14 at 17:04








1




1




The command above looks correct to me. when writing your batch file, what program did you use?
– Stese
May 14 at 14:54




The command above looks correct to me. when writing your batch file, what program did you use?
– Stese
May 14 at 14:54












As I read the documentation, the password should follow the network share address.
– AFH
May 14 at 15:34




As I read the documentation, the password should follow the network share address.
– AFH
May 14 at 15:34












@Stese I used both the command window and a SQL Server cmd call. Both returned the same error.
– Bill Greer
May 14 at 16:13




@Stese I used both the command window and a SQL Server cmd call. Both returned the same error.
– Bill Greer
May 14 at 16:13












@AFH Can you point me to the documentation you read?
– Bill Greer
May 14 at 16:14




@AFH Can you point me to the documentation you read?
– Bill Greer
May 14 at 16:14












Type net use /?. or look here.
– AFH
May 14 at 17:04




Type net use /?. or look here.
– AFH
May 14 at 17:04










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










Please try using:



net use H: \MYSERVERMYFOLDERSBackup oasddkjkla /user:ABCCompanyJoeUser 





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',
    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%2f1322563%2fhow-do-i-pass-the-password-to-a-net-use-command-without-being-prompted%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








    up vote
    2
    down vote



    accepted










    Please try using:



    net use H: \MYSERVERMYFOLDERSBackup oasddkjkla /user:ABCCompanyJoeUser 





    share|improve this answer



























      up vote
      2
      down vote



      accepted










      Please try using:



      net use H: \MYSERVERMYFOLDERSBackup oasddkjkla /user:ABCCompanyJoeUser 





      share|improve this answer

























        up vote
        2
        down vote



        accepted







        up vote
        2
        down vote



        accepted






        Please try using:



        net use H: \MYSERVERMYFOLDERSBackup oasddkjkla /user:ABCCompanyJoeUser 





        share|improve this answer














        Please try using:



        net use H: \MYSERVERMYFOLDERSBackup oasddkjkla /user:ABCCompanyJoeUser 






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 3 at 15:45









        mwfearnley

        4,76431624




        4,76431624










        answered May 16 at 19:31









        David Rossi

        361




        361






























            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%2f1322563%2fhow-do-i-pass-the-password-to-a-net-use-command-without-being-prompted%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

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix