Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



Sign in to follow this  
Nepali

autoit script script to open close folder

Recommended Posts

what will be the autoit script to opea a particular folder (assum windows)

and close it automatically after 15~20 sec

open it and close after 20 sec

Share this post


Link to post
Share on other sites

Using a For loop to open and close Windows folder twice

For $i = 1 To 2
   Run('explorer ' & @WindowsDir)
   Sleep(20000)
   WinClose('WINDOWS')
Next

Share this post


Link to post
Share on other sites
For $i = 1 To 2
   Run('explorer ' & @WindowsDir & '\Fonts')
   Sleep(20000)
   WinClose('Fonts')
Next

Share this post


Link to post
Share on other sites

did not worked....

opened fontfolder in maximized order

after 20 sec it restored

but didn't closed..

Share this post


Link to post
Share on other sites

For $i = 1 To 2
  $pid = Run('explorer ' & @WindowsDir & '\Fonts')
  Sleep(20000)
  ProcessClose($pid)
Next

This might work instead - it uses the process id (pid) retrieved from the Run function, so that the window title of the fonts folder doesn't matter.

Got it from the AutoIt help file > Function reference > Process management

Share this post


Link to post
Share on other sites

i tried the script

it opened the font folder

then after 20 sec.. it restored the windows (maximized to restore mode)

doesn't closes the font folder

its there only

only the size of the windows is changed..

i am shocked

i have attached both the screenshot (initial and final)

first one is the open stage

second one is after 20 sec is passed

post-63695-1125595264_thumb.jpg

post-63695-1125595442_thumb.jpg

Share this post


Link to post
Share on other sites

That's weird...

Btw, i tested both scripts and mine didn't work, but the one MHz provided did the job just fine...

Run('explorer ' & @WindowsDir & '\Fonts')
Sleep(20000)
WinClose('Fonts')

Maybe if you tried quotes instead? (" instead of ')?

And does it work with any other folder?

Share this post


Link to post
Share on other sites

still same problem

opens fine but finally restored covering half windows

Share this post


Link to post
Share on other sites

I'm sorry, i'm out of ideas... can't help you there.

Try searching the AutoIt forums, perhaps you'll find an answer there. Since it's happening on your pc and not on mine, i'm guessing it's related to the way you set up Windows or AutoIt, but that's as far as my knowledge goes...

http://www.autoitscript.com/forum/

Good luck!

Share this post


Link to post
Share on other sites
still same problem

opens fine but finally restored covering half windows

You have your titles set for full path to be shown. So I will use a substring option to cater for it

Opt("WinTitleMatchMode", 2)

For $i = 1 To 2
  Run('explorer ' & @WindowsDir)
  Sleep(20000)
  WinClose('WINDOWS')
Next

For $i = 1 To 2
  Run('explorer ' & @WindowsDir & '\Fonts')
  Sleep(20000)
  WinClose('Fonts')
Next

Share this post


Link to post
Share on other sites

yessssssssssssssss,,

worked fine

Opt("WinTitleMatchMode", 2)

  Run('explorer ' & @WindowsDir & '\Fonts')

  Sleep(9000)

  WinClose('Fonts')

thanks Mhz, Mojo

Share this post


Link to post
Share on other sites

Here's an alternative script to Autoit.

explorer %systemroot%\fonts
ping -n 10 127.0.0.1>nul
taskkill /fi "windowtitle eq %systemroot%\Fonts" /im explorer.exe
taskkill /fi "windowtitle eq Fonts" /im explorer.exe

Edited by vcBlackBox

Share this post


Link to post
Share on other sites

i appreciate the command

i think this a command script

but didn't worked in mine

the command windows exit leaving font folder opened

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×