Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

autoit script script to open close folder

- - - - -

  • Please log in to reply
17 replies to this topic

#1
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
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


How to remove advertisement from MSFN

#2
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,659 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag
Using a For loop to open and close Windows folder twice

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


#3
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
what abt font folder

#4
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,659 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag
For $i = 1 To 2

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

    Sleep(20000)

    WinClose('Fonts')

Next


#5
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
did not worked....
opened fontfolder in maximized order
after 20 sec it restored

but didn't closed..

#6
Mojo

Mojo

    Newbie

  • Member
  • 21 posts
  • Joined 23-August 05
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

#7
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
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

Attached Files



#8
Mojo

Mojo

    Newbie

  • Member
  • 21 posts
  • Joined 23-August 05
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?

#9
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
still same problem

opens fine but finally restored covering half windows

#10
Mojo

Mojo

    Newbie

  • Member
  • 21 posts
  • Joined 23-August 05
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!

#11
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,659 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag

still same problem

opens fine but finally restored covering half windows

<{POST_SNAPBACK}>

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


#12
Mojo

Mojo

    Newbie

  • Member
  • 21 posts
  • Joined 23-August 05
****, curse me...
Can't believe i didn't think of that :/

#13
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
yessssssssssssssss,,

worked fine

Opt("WinTitleMatchMode", 2)

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



thanks Mhz, Mojo

#14
vcBlackBox

vcBlackBox

    Member

  • Member
  • PipPip
  • 144 posts
  • Joined 22-September 04
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, 03 September 2005 - 11:37 AM.


#15
Nepali

Nepali

    Pride of Nepal

  • Member
  • PipPipPipPip
  • 519 posts
  • Joined 09-July 05
i appreciate the command

i think this a command script

but didn't worked in mine


the command windows exit leaving font folder opened

#16
vcBlackBox

vcBlackBox

    Member

  • Member
  • PipPip
  • 144 posts
  • Joined 22-September 04
made a slight change, try it again.

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, 03 September 2005 - 11:39 AM.


#17
msubedi

msubedi
  • Member
  • 4 posts
  • Joined 07-July 05
what is the changes... i don't see anything new

#18
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,659 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag

what is the changes... i don't see anything new

<{POST_SNAPBACK}>

This post has been edited by vcBlackBox: Today, 03:37 AM

That is because the comparison has been edited.

Edit: Specifing changes can save misleading people. :wacko:

Edited by MHz, 03 September 2005 - 10:19 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users