DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: close folders  (Read 17,270 times)

ajlewis

  • Participant
  • Joined in 2009
  • *
  • Posts: 3
close folders
« on: January 07, 2009, 04:21 PM »
I'm new here so excuse this if it has appeared already.
When I open a folder and execute a file the containing folder remains open. Is there a simple script to close the folder when I launch a file?
Thanks!  :)

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: close folders
« Reply #1 on: January 10, 2009, 03:48 AM »
:) Try RunToClose!

RunToClose - DoubleClicking a file in Explorer closes Explorer afterwards.

You'll find the downloads and more info at 1 Hour Software by Skrommel.

Skrommel

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: close folders
« Reply #2 on: January 10, 2009, 09:44 PM »
Skrommel's on fire again  :huh: :huh: :huh:  :Thmbsup: :Thmbsup: :Thmbsup:

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
Re: close folders
« Reply #3 on: January 10, 2009, 11:06 PM »
Is there a simple script to close the folder when I launch a file?
This is simple.  Hold down the Left Control key and Right Click on an object.  The object opens and the parent window closes.  The folder always closes but sometimes the file doesn't open (it's a timing thing), which can be irritating.  But it is simple  ;D
Code
;CloseParent.ahk
;
;In an Explorer Window, hold down Left-Control and RightClick on a
;folder,shortcut,or file.  The folder/shortcut/file will open/run
;and the Explorer Window will close.
;
;If you LeftControl-RightClick anyplace other than an object,
;eg a window background, the window will close, very handy
;
;sometimes the timing doesn't work, hence the sleeps

#SingleInstance,Force
#Persistent
Menu,Tray,Tip,CloseParent

LControl & RButton::
MouseGetPos,xpos,ypos,ParentWin
sleep, 100
MouseClick,Left,%xpos%,%ypos%,2
sleep, 200
Winclose,ahk_id %ParentWin%
return

Original address: https://www.donationcoder.com/forum/index.php?topic=16466.0