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


  1. Posts : 3
    Windows 7 x64 Home
       #1

    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 Computer


  2. Posts : 6,668
    Windows 7 x64
       #2

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

    Close an Open File
      My Computer


  3. Posts : 3
    Windows 7 x64 Home
    Thread Starter
       #3

    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 Computer


  4. Posts : 3
    Windows 7 x64 Home
    Thread Starter
       #4

    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 Computer


  5. Posts : 4
    x
       #5

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 17:08.
Find Us