Page 1 of 2
DIR /s Command on Mapped Drives
Posted: 25 Sep 2016 07:02
by dcampbe1
Using the command "dir *. /s /ad" on a local drive gives me expected results.
Using the same command on a mapped drive gives me only the root directory.
However if I include a folder name on that mapped drive, e.g., "dir \steve /s /ad" I do get expected results, i.e., many folders in that subdirectory.
Basically the /s does not work at the root level of a mapped drive, but does work within any of the folders below the root level.
I need someway to get a list of all folder names of a mapped drive. I'm not proficient enough to write a script to drill through all of the root directories one at a time to get those respective folder names and could sure use some help/ideas.
Thanks
Re: DIR /s Command on Mapped Drives
Posted: 25 Sep 2016 15:22
by foxidrive
It should work just fine.
What kind of drive is being mapped? NTFS format?
Is it from a Linux box?
try using just
Re: DIR /s Command on Mapped Drives
Posted: 25 Sep 2016 17:24
by dcampbe1
foxidrive wrote:It should work just fine.
What kind of drive is being mapped? NTFS format?
Is it from a Linux box?
try using just
It's an external Seagate 4tB NTFS drive from a Win7 64bit machine. I'm accessing it from a Win10 64-bit box. No matter the combination of DOS commands, I can't get past the root listing of folders/files. Specifying any/every sub-folder works as advertised and lets me drill down with no problem. Directly connected drives present no problem, just the mapped ones.
Re: DIR /s Command on Mapped Drives
Posted: 25 Sep 2016 19:54
by foxidrive
dcampbe1 wrote:It's an external Seagate 4tB NTFS drive from a Win7 64bit machine. I'm accessing it from a Win10 64-bit box. No matter the combination of DOS commands, I can't get past the root listing of folders/files. Specifying any/every sub-folder works as advertised and lets me drill down with no problem. Directly connected drives present no problem, just the mapped ones.
What do you see in the cmd prompt when you type this command?
foxidrive wrote:try using just
The command works on a mapped drive and the problem seems to stem from some issue with your particular setup.
Map a different HDD and check that one as a test.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 02:43
by dcampbe1
foxidrive wrote:dcampbe1 wrote:It's an external Seagate 4tB NTFS drive from a Win7 64bit machine. I'm accessing it from a Win10 64-bit box. No matter the combination of DOS commands, I can't get past the root listing of folders/files. Specifying any/every sub-folder works as advertised and lets me drill down with no problem. Directly connected drives present no problem, just the mapped ones.
What do you see in the cmd prompt when you type this command?
foxidrive wrote:try using just
The command works on a mapped drive and the problem seems to stem from some issue with your particular setup.
Map a different HDD and check that one as a test.
I get proper responses when using any variation of the command against non-mapped (local) drives, but using virtually any variation of the command against any mapped drive displays the folder contents of the root directory only. The only way to get out of the root directory is to specify the command against one of its sub-directories. There's no problem at all once I'm below the root directory.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 03:12
by foxidrive
dcampbe1 wrote:I get proper responses when using any variation of the command against non-mapped (local) drives, but using virtually any variation of the command against any mapped drive displays the folder contents of the root directory only.
We can't diagnose what we can't see: I'm only making that point because there is no problem here and I've never had a problem with a mapped drive in that way.
You could be running a batch script that is doing something odd and I would only ever find out if you posted that code.
But a test you can run is to map the same external drive on another PC.
and also use a different PC to access the current pc and drive.
These tests would help to rule out permission and OS issues.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 03:16
by foxidrive
dcampbe1 wrote:I'm accessing it from a Win10 64-bit box.
Other blokes can test this on Win10 as it's not as OS I've felt the need to tinker with yet.
There have been a number of comments here about peculiarities with Win10.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 03:23
by dcampbe1
foxidrive wrote:dcampbe1 wrote:I get proper responses when using any variation of the command against non-mapped (local) drives, but using virtually any variation of the command against any mapped drive displays the folder contents of the root directory only.
We can't diagnose what we can't see: I'm only making that point because there is no problem here and I've never had a problem with a mapped drive in that way.
You could be running a batch script that is doing something odd and I would only ever find out if you posted that code.
But a test you can run is to map the same external drive on another PC.
and also use a different PC to access the current pc and drive.
These tests would help to rule out permission and OS issues.
I've been doing all this testing from a DOS prompt on my Win10 machine without a script. Using virtually any combination of commands on any drive on that machine produces expected results. Using those same commands on any mapped drive of either of two other Win7 machines locks me into the root level of those drives. The response on any such command is simply a re-display of the root directory. The only way out is to either forget mapped drives altogether; or specify each sub-directory under the root directory. The later option is laborious and tedious and would requires a "for" loop script which I don't understand enough to use.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 03:29
by foxidrive
dcampbe1 wrote:I've been doing all this testing from a DOS prompt on my Win10 machine without a script. Using virtually any combination of commands on any drive on that machine produces expected results. Using those same commands on any mapped drive of either of two other Win7 machines locks me into the root level of those drives. The response on any such command is simply a re-display of the root directory.
Check the permissions.
Do those tests to eliminate the machines too.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 03:40
by dcampbe1
The only way out is to either forget mapped drives altogether; or specify each sub-directory under the root directory. The later option is laborious and tedious and would requires a "for" loop script which I don't understand enough to use.
Given this is a Win10 issue, I need to find a Win10 solution (lot's of luck Charlie!) or as I mentioned, get help writing a script that will transverse each root sub-directory individually and perform the "dir *.* /s /ad >> catch.txt" or some such similar command.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 03:43
by foxidrive
dcampbe1 wrote:Given this is a Win10 issue
That's not proven in the way I see this issue, from the information provided.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 04:04
by dcampbe1
foxidrive wrote:dcampbe1 wrote:Given this is a Win10 issue
That's not proven in the way I see this issue, from the information provided.
Other blokes can test this on Win10 as it's not as OS I've felt the need to tinker with yet.
There have been a number of comments here about peculiarities with Win10.
I apologize. I responded to the Win10 issue response you sent earlier but it seems to have found its way to the bit bucket. I intended to say what a great idea that was. It caused me to go to one of the Win7 machines and perform the same commands on it. The results were astonishing. Everything worked as it is supposed to, including a DIR of mapped drives. To me this ruled out every thing except a Win10 issue.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 06:29
by Squashman
Give this a try from the cmd prompt.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 07:09
by dcampbe1
Squashman wrote:Give this a try from the cmd prompt.
That's exactly what the doctor ordered -- almost. It does what I want it to but lists literally ever folder on the entire drive. I would like to use the same command with a filter to give me only folders with names containing "BI.$BIRIS".
I know this isn't a fix for whatever problem I have with Win10 but it does the job. I only wish I knew the "for" command as well as the old DOS.
Re: DIR /s Command on Mapped Drives
Posted: 26 Sep 2016 07:14
by Squashman
dcampbe1 wrote:Squashman wrote:Give this a try from the cmd prompt.
That's exactly what the doctor ordered -- almost. It does what I want it to but lists literally ever folder on the entire drive. I would like to use the same command with a filter to give me only folders with names containing "BI.$BIRIS".
I know this isn't a fix for whatever problem I have with Win10 but it does the job. I only wish I knew the "for" command as well as the old DOS.
The asterisk is a wild card. It is no different then when you were using
*.* with your DIR command.