Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How do I Close an opened folder in Run or at the Command prompt

16 Nov 2011   #1
jalewis999

Windows 7 x64 Home
 
 
How do I Close an opened folder in Run or at the Command prompt

I have an application that opens a folder using a shell to Explorer. I can close Most apps I shell using Taskkill but not the opened folder. I have tried Openfiles with no luck ( I think it is for networks). I need this to tidy up an application.

Thank you.


My System SpecsSystem Spec
.

16 Nov 2011   #2
Maguscreed

Microsoft Community Contributor Award Recipient

Windows 7 x64
 
 

I believe you may find your solution here it would seem to work on open folders to an extent.

Close an Open File
My System SpecsSystem Spec
16 Nov 2011   #3
jalewis999

Windows 7 x64 Home
 
 

Sorry I think this is for shared file and folders. I type net file and nothing is listed. The file requires a special ID.
My System SpecsSystem Spec
.


17 Nov 2011   #4
jalewis999

Windows 7 x64 Home
 
 

Still no luck. I have had three ideas on how to close this folder. I need help with finding out if they are possible.
1. The folder was opened using Explorer. Explorer "Folder Path". Maybe Explorer has other Command line options to close?

2. The Folder can be closed using Task Manager. Maybe taskmgr.exe has command line options.

3. The Folder can close itself with Ctrl|W. Is there a way of issuing those keystrokes without typing. I think the Folder will be in focus.

I appreciate any help. Thank You.
My System SpecsSystem Spec
11 Jul 2014   #5
tazogamer

 
 

I know, that topic is old, but problem is actual, so SOLUTION was here -
http://www.msfn.org/board/topic/1383...bat/?p=1081976



method 1 :



With CMD(command prompt):
TASKKILL /F /FI "WINDOWTITLE eq MYTITLEEEEEEEEEEEEEE" /IM explorer.exe (just change MYTITLEEEEEEEEEEEEEE with the opened folder's title [case-sensitive])





method 2 :
open a new text document and enter this code:


Set oShell = CreateObject("WScript.Shell") If oShell.AppActivate("YourWindowTITLEEEEEEEEEEEEE") Then WScript.Sleep 100 oShell.SendKeys "%{F4}" End If
then save that file as yourfile.vbs and put to your desired path.
Then run the Command:
%windir%\system32\cmd.exe /C "START /WAIT CScript C:\ExampleFolder\yourfile.vbs //NoLogo"

(note,that you should change "YourWindowTITLEEE" and "yourFileName.vbs" to whatever you want. Below is just an

My System SpecsSystem Spec
Reply

 How do I Close an opened folder in Run or at the Command prompt




Thread Tools





Similar help and support threads
Thread Forum
Folder - Delete from Command Prompt
How to Delete a Folder in Windows from the Command Prompt This will show you how to permanently delete a Folder in Vista, Windows 7, or Windows 8 using the RD or RMDIR command from within a command prompt. This can be handy if you cannot delete the folder using the normal methods. ...
Tutorials
double clicking a folder opens a command prompt
dear sir, till yesterday. it was ok. since today morning, this problem appears. when i double click a folder to open it, it asks for permission to open with windows command processor. if i click on yes, a command prompt appears and commands keep on scrolling. if i right click on the folder, then...
General Discussion
Run administrative command prompt from command prompt
Ok So I got myself into a unique bind here. I was trying to install some custom system files (for a theme) and I did it wrong and now I cant open explorer.exe . I dont want to goto a backup because this is a easy fix. (in my view). So I need to know how to run command prompt with administrative...
General Discussion
Windows 7 SP1 Can Crash If Command Prompt Is Opened and Closed
Windows 7 SP1 Can Crash If Command Prompt Is Opened and Closed Repeatedly Windows 7 SP1 Can Crash If Command Prompt Is Opened and Closed Repeatedly - Softpedia
Windows Updates & Activation
Command Prompt command <ipconfig> not working
when I open up my command prompt and type 'ipconfig' without the ' and press enter it returns the line: 'ipconfig' is nto recognized as an internal or external command, operable program, or batch file I am trying to find out the information I need in order to set up a static IP Address for port...
Network & Sharing
File and Folder - Rename from Command Prompt
How to Rename a File and Folder from the Command Prompt This will show you how to rename a file and folder using the REN or RENAME command from within a command prompt. This can be handy if you cannot rename the file or folder normally. Normally you would just right click on the file or...
Tutorials

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:36.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App