Friday, 21 June 2019

windows 7 - Why doesn't DIR show C:UsersYours TrulyAppData?


[Pardon the Windows-noob question!]


It often happens that the paths I can read off the Windows Explorer GUI do not correspond to anything I can see with DIR (in the CMD command line).


For example, if I run this in CMD:


C:\>dir "Users\Yours Truly"

the output does not show anything resembling AppData, and yet


C:\>cd "Users\Yours Truly\AppData"

succeeds, and now the CMD prompt reads C:\Users\Yours Truly\AppData>, and, unsurprisingly, running CD without arguments just confirms this:


C:\Users\Yours Truly\AppData>cd
C:\Users\Yours Truly\AppData



I can think of two possible explanations (though I'm sure there are many more):



  1. C:\Users\Yours Truly\AppData is not a "real" path; it gets translated to the real path behind the scenes;

  2. C:\Users\Yours Truly\AppData is an "invisible" path, not normally displayed by DIR;


(Certainly, 1 and 2 are not mutually exclusive: C:\Users\Yours Truly\AppData could be a special type of shortcut that is not displayed by DIR (at least by default).)


Could someone shed some light on this situation? If (1) is true, how can I find out the "real" path? If (2) is true, how can I instruct DIR to display paths like C:\Users\Yours Truly\AppData?


Thanks!



Answer



It's marked as hidden. You can view it if you do dir /ah "C:\Users\Yours Truly"... or dir /ad "C:\Users\Yours Truly". (ah = all hidden files, ad = all directories including hidden)


Another quick shortcut to get there is: use


CD %appdata%\..

%appdata% is an environment variable that defaults to your current appdata folder. In Windows, this can be roaming, local, or localnew. Almost everything uses C:\Users\Yours Truly\AppData\Roaming... so in most cases it's probably better just to use the %appdata% variable instead of the parent directory of %appdata%.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...