Is it possible to access an NAS drive via CMD and copy all file names from it into a specific file?












0















There is a way within Windows to access a certain folder and copy all of it's contents names into a text file.



For example if I am in C:UsersmyusernameDocuments



And in the command line I type dir > C:dir.txt, when I navigate into the Documents folder, there will be a text file named 'dir.txt', I can now open it and all the names of all the files within my Documents folder will be there (unless thres nothing inside Documents).



My problem is a bit different.



I am trying to access an NAS Drive. The path of the file in my example is \10.51.0.11nasWhatever320PSTs_from_Whatever.



If I try to navigate here from the command prompt I receive the error:




CMD does not support UNC paths as current directories.




I have many, thousands of file names to copy and paste into Excel from this drive and I need a way of doing it other than manually.



The option of copying and pasting these files is out of the question as it would take many days to make copies from the NAS onto my local network or computer.










share|improve this question





























    0















    There is a way within Windows to access a certain folder and copy all of it's contents names into a text file.



    For example if I am in C:UsersmyusernameDocuments



    And in the command line I type dir > C:dir.txt, when I navigate into the Documents folder, there will be a text file named 'dir.txt', I can now open it and all the names of all the files within my Documents folder will be there (unless thres nothing inside Documents).



    My problem is a bit different.



    I am trying to access an NAS Drive. The path of the file in my example is \10.51.0.11nasWhatever320PSTs_from_Whatever.



    If I try to navigate here from the command prompt I receive the error:




    CMD does not support UNC paths as current directories.




    I have many, thousands of file names to copy and paste into Excel from this drive and I need a way of doing it other than manually.



    The option of copying and pasting these files is out of the question as it would take many days to make copies from the NAS onto my local network or computer.










    share|improve this question



























      0












      0








      0








      There is a way within Windows to access a certain folder and copy all of it's contents names into a text file.



      For example if I am in C:UsersmyusernameDocuments



      And in the command line I type dir > C:dir.txt, when I navigate into the Documents folder, there will be a text file named 'dir.txt', I can now open it and all the names of all the files within my Documents folder will be there (unless thres nothing inside Documents).



      My problem is a bit different.



      I am trying to access an NAS Drive. The path of the file in my example is \10.51.0.11nasWhatever320PSTs_from_Whatever.



      If I try to navigate here from the command prompt I receive the error:




      CMD does not support UNC paths as current directories.




      I have many, thousands of file names to copy and paste into Excel from this drive and I need a way of doing it other than manually.



      The option of copying and pasting these files is out of the question as it would take many days to make copies from the NAS onto my local network or computer.










      share|improve this question
















      There is a way within Windows to access a certain folder and copy all of it's contents names into a text file.



      For example if I am in C:UsersmyusernameDocuments



      And in the command line I type dir > C:dir.txt, when I navigate into the Documents folder, there will be a text file named 'dir.txt', I can now open it and all the names of all the files within my Documents folder will be there (unless thres nothing inside Documents).



      My problem is a bit different.



      I am trying to access an NAS Drive. The path of the file in my example is \10.51.0.11nasWhatever320PSTs_from_Whatever.



      If I try to navigate here from the command prompt I receive the error:




      CMD does not support UNC paths as current directories.




      I have many, thousands of file names to copy and paste into Excel from this drive and I need a way of doing it other than manually.



      The option of copying and pasting these files is out of the question as it would take many days to make copies from the NAS onto my local network or computer.







      windows-7 windows microsoft-office






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 10 '15 at 21:57









      JakeGould

      32.2k1098141




      32.2k1098141










      asked Sep 10 '15 at 21:17









      Space GhostSpace Ghost

      5361916




      5361916






















          2 Answers
          2






          active

          oldest

          votes


















          3














          You can tell dir what path to list. So you could use:



          dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:dir.txt






          share|improve this answer
























          • Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

            – Space Ghost
            Sep 10 '15 at 21:26











          • @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

            – Ƭᴇcʜιᴇ007
            Sep 10 '15 at 21:29













          • @Techie007, Yes, I can.

            – Space Ghost
            Sep 10 '15 at 21:31











          • You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

            – Space Ghost
            Sep 10 '15 at 21:37











          • Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

            – Ƭᴇcʜιᴇ007
            Sep 10 '15 at 21:37





















          1














          Try below steps,




          1. Use "map network drive" to attach the NAS folder path to a drive name eg. z: or X:.

          2. From the cmd try accessing the network path by typing "z:" and hit enter.

          3. Now you can execute any command you want on the NAS folder






          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%2f971282%2fis-it-possible-to-access-an-nas-drive-via-cmd-and-copy-all-file-names-from-it-in%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            You can tell dir what path to list. So you could use:



            dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:dir.txt






            share|improve this answer
























            • Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

              – Space Ghost
              Sep 10 '15 at 21:26











            • @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:29













            • @Techie007, Yes, I can.

              – Space Ghost
              Sep 10 '15 at 21:31











            • You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

              – Space Ghost
              Sep 10 '15 at 21:37











            • Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:37


















            3














            You can tell dir what path to list. So you could use:



            dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:dir.txt






            share|improve this answer
























            • Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

              – Space Ghost
              Sep 10 '15 at 21:26











            • @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:29













            • @Techie007, Yes, I can.

              – Space Ghost
              Sep 10 '15 at 21:31











            • You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

              – Space Ghost
              Sep 10 '15 at 21:37











            • Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:37
















            3












            3








            3







            You can tell dir what path to list. So you could use:



            dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:dir.txt






            share|improve this answer













            You can tell dir what path to list. So you could use:



            dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:dir.txt







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 10 '15 at 21:20









            Ƭᴇcʜιᴇ007Ƭᴇcʜιᴇ007

            99.9k14158221




            99.9k14158221













            • Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

              – Space Ghost
              Sep 10 '15 at 21:26











            • @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:29













            • @Techie007, Yes, I can.

              – Space Ghost
              Sep 10 '15 at 21:31











            • You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

              – Space Ghost
              Sep 10 '15 at 21:37











            • Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:37





















            • Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

              – Space Ghost
              Sep 10 '15 at 21:26











            • @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:29













            • @Techie007, Yes, I can.

              – Space Ghost
              Sep 10 '15 at 21:31











            • You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

              – Space Ghost
              Sep 10 '15 at 21:37











            • Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

              – Ƭᴇcʜιᴇ007
              Sep 10 '15 at 21:37



















            Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

            – Space Ghost
            Sep 10 '15 at 21:26





            Thanks for the reply. I don't get the error I used to anymore, however the message I get is 'Access Denied' even when I run CMD as administrator.

            – Space Ghost
            Sep 10 '15 at 21:26













            @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

            – Ƭᴇcʜιᴇ007
            Sep 10 '15 at 21:29







            @SpaceGhost Sounds like you need to ensure you've got proper permission to that folder. Can you navigate to the path via Windows Explorer?

            – Ƭᴇcʜιᴇ007
            Sep 10 '15 at 21:29















            @Techie007, Yes, I can.

            – Space Ghost
            Sep 10 '15 at 21:31





            @Techie007, Yes, I can.

            – Space Ghost
            Sep 10 '15 at 21:31













            You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

            – Space Ghost
            Sep 10 '15 at 21:37





            You're correct. I've been an idiot. I can't access it via Windows Explorer. I access this file path via a drive that's shared on our server. The path is a shortcut inside my folder and I navigate to it through that. Thank you for clearing that mistake up. I will attempt something else, if it works, I will post it and accept your answer. :)

            – Space Ghost
            Sep 10 '15 at 21:37













            Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

            – Ƭᴇcʜιᴇ007
            Sep 10 '15 at 21:37







            Ahh, it may be because you're trying to save the dir.txt output file to the root of C:, which is not allowed (that's what's giving you the access denied error). Try just dir \10.51.0.11nasWhatever320PSTs_from_Whatever on it's own. Does it give you the list? If so, then make a folder and use something like dir \10.51.0.11nasWhatever320PSTs_from_Whatever > C:<folder you made>dir.txt

            – Ƭᴇcʜιᴇ007
            Sep 10 '15 at 21:37















            1














            Try below steps,




            1. Use "map network drive" to attach the NAS folder path to a drive name eg. z: or X:.

            2. From the cmd try accessing the network path by typing "z:" and hit enter.

            3. Now you can execute any command you want on the NAS folder






            share|improve this answer




























              1














              Try below steps,




              1. Use "map network drive" to attach the NAS folder path to a drive name eg. z: or X:.

              2. From the cmd try accessing the network path by typing "z:" and hit enter.

              3. Now you can execute any command you want on the NAS folder






              share|improve this answer


























                1












                1








                1







                Try below steps,




                1. Use "map network drive" to attach the NAS folder path to a drive name eg. z: or X:.

                2. From the cmd try accessing the network path by typing "z:" and hit enter.

                3. Now you can execute any command you want on the NAS folder






                share|improve this answer













                Try below steps,




                1. Use "map network drive" to attach the NAS folder path to a drive name eg. z: or X:.

                2. From the cmd try accessing the network path by typing "z:" and hit enter.

                3. Now you can execute any command you want on the NAS folder







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 25 at 0:39









                Raphael OscarRaphael Oscar

                111




                111






























                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f971282%2fis-it-possible-to-access-an-nas-drive-via-cmd-and-copy-all-file-names-from-it-in%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

                    Origin of the phrase “under your belt”?