Page 1 of 1

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

Posted: 18 Apr 2019 03:23
by Noobknight
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!

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

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

Code: Select all

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

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

Posted: 18 Apr 2019 21:19
by Noobknight
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"