I want to skip "Appdata" when "dir /b /s /ad" command is executed

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Moonshine
Posts: 1
Joined: 18 Apr 2017 00:14

I want to skip "Appdata" when "dir /b /s /ad" command is executed

#1 Post by Moonshine » 18 Apr 2017 00:25

I am listing all of the folders in %userprofile% but Appdata is big and I dont find it relevant, can I make dir avoid Appdata?

Code: Select all

@echo off
cd %userprofile%
dir /b /s /ad
pause

elzooilogico
Posts: 128
Joined: 23 May 2016 15:39
Location: Spain

Re: I want to skip "Appdata" when "dir /b /s /ad" command is executed

#2 Post by elzooilogico » 18 Apr 2017 05:06

try

Code: Select all

dir /b /s /ad | findstr /VI "appdata" 
also, you may want to avoid more than one folder

Code: Select all

dir /b /s /ad | findstr /VI "appdata documents desktop"

Compo
Posts: 600
Joined: 21 Mar 2014 08:50

Re: I want to skip "Appdata" when "dir /b /s /ad" command is executed

#3 Post by Compo » 18 Apr 2017 12:39

As we really have little idea as to your full intention, you may be able to use:

Code: Select all

DIR/B/S/AD-S-H
…this will not output system or hidden directories

Post Reply