Is there any way to know a folder is open or not using command line?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Noobknight
Posts: 5
Joined: 18 Nov 2018 20:31

Is there any way to know a folder is open or not using command line?

#1 Post by Noobknight » 18 Apr 2019 03:23

Hi guys!
I want to check folder "Downloads" is opening or not using command line. I tried with wmic or find commands to get process of Windows Explorer but still stuck. :cry:
Many Thanks!

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Is there any way to know a folder is open or not using command line?

#2 Post by Squashman » 18 Apr 2019 08:27

Learned this from dbenham.

Code: Select all

2>nul ren Downloads Downloads && echo Folder is NOT locked || echo folder is LOCKED

Noobknight
Posts: 5
Joined: 18 Nov 2018 20:31

Re: Is there any way to know a folder is open or not using command line?

#3 Post by Noobknight » 18 Apr 2019 21:19

Squashman wrote:
18 Apr 2019 08:27
Learned this from dbenham.

Code: Select all

2>nul ren Downloads Downloads && echo Folder is NOT locked || echo folder is LOCKED
Thanks for reply bro!
But when I opened folder "Downloads" command line "ren" or "rename" still working fine. It only throw error when I open a sub folder in "Downloads"

Post Reply