Solved How to close a particular opened folder using cmd ?

October 28, 2017 at 09:49:04
Specs: Windows, 2 GB
How to close a particular opened folder using cmd ?

for example , i want to close

c:\foldername\

this folder using cmd or batch. Please help.


See More: How to close a particular opened folder using cmd ?

Reply ↓  Report •

#1
October 28, 2017 at 10:25:41
If you're in the command-line, it's the same as in MS-DOS:

To return to the root directory:

"cd\"

To return up one directory:

"cd.."

(without the quotes, of course)

"Channeling the spirit of jboy..."

message edited by T-R-A


Reply ↓  Report •

#2
October 28, 2017 at 12:43:26
I not mean , going to home directory (cd/) or going a step backward of directory(cd..)

i asked for how to close a particular opened folder (in explorer) not in cmd. Note down the question, using cmd.


Reply ↓  Report •

#3
October 28, 2017 at 18:29:54
✔ Best Answer
In CMD? You can't.
In VBScript or PowerShell? Sure.
PowerShell version would look like this:
(New-Object -c Shell.Application).Windows() | 
 ? { $_.Document.Folder.Self.Path -eq "C:\Windows\System32" } |
 % { $_.Quit() }

With that, you can call PowerShell from a batch file, if you must:

SET closeWin=C:\Windows\System32
powershell -encodedcommand KAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIAAtAGMAIA^
BTAGgAZQBsAGwALgBBAHAAcABsAGkAYwBhAHQAaQBvAG4AKQAuAFcAaQBuAGQAbwB3AHM^
AKAApAHwAPwB7ACQAXwAuAEQAbwBjAHUAbQBlAG4AdAAuAEYAbwBsAGQAZQByAC4AUwBl^
AGwAZgAuAFAAYQB0AGgAIAAtAGUAcQAgACQAZQBuAHYAOgBDAGwAbwBzAGUAVwBpAG4Af^
QApAC4AUQB1AGkAdAAoACkA

How To Ask Questions The Smart Way


Reply ↓  Report •
Related Solutions


Ask Question