MSFN Forum: autoit script script to open close folder - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

autoit script script to open close folder need script to open/close a folder Rate Topic: -----

#1 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 01 September 2005 - 07:11 AM

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


#2 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 01 September 2005 - 07:41 AM

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 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 01 September 2005 - 07:43 AM

what abt font folder

#4 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 01 September 2005 - 07:47 AM

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


#5 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 01 September 2005 - 10:35 AM

did not worked....
opened fontfolder in maximized order
after 20 sec it restored

but didn't closed..

#6 User is offline   Mojo 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 23-August 05

Posted 01 September 2005 - 11:11 AM

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 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 01 September 2005 - 11:24 AM

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 File(s)



#8 User is offline   Mojo 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 23-August 05

Posted 01 September 2005 - 11:33 AM

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 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 01 September 2005 - 11:44 AM

still same problem

opens fine but finally restored covering half windows

#10 User is offline   Mojo 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 23-August 05

Posted 01 September 2005 - 12:14 PM

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 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

  Posted 01 September 2005 - 12:25 PM

Nepali, on Sep 2 2005, 03:44 AM, said:

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 User is offline   Mojo 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 23-August 05

Posted 02 September 2005 - 09:23 PM

****, curse me...
Can't believe i didn't think of that :/

#13 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 02 September 2005 - 09:43 PM

yessssssssssssssss,,

worked fine

Quote

Opt("WinTitleMatchMode", 2)

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



thanks Mhz, Mojo

#14 User is offline   vcBlackBox 

  • Member
  • PipPip
  • Group: Members
  • Posts: 144
  • Joined: 22-September 04

Posted 03 September 2005 - 11:18 AM

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

This post has been edited by vcBlackBox: 03 September 2005 - 11:37 AM


#15 User is offline   Nepali 

  • Pride of Nepal
  • PipPipPipPip
  • Group: Members
  • Posts: 519
  • Joined: 09-July 05

Posted 03 September 2005 - 11:31 AM

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 User is offline   vcBlackBox 

  • Member
  • PipPip
  • Group: Members
  • Posts: 144
  • Joined: 22-September 04

Posted 03 September 2005 - 11:38 AM

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

This post has been edited by vcBlackBox: 03 September 2005 - 11:39 AM


#17 User is offline   msubedi 

  • Group: Members
  • Posts: 4
  • Joined: 07-July 05

Posted 03 September 2005 - 09:56 PM

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

#18 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 03 September 2005 - 10:17 PM

msubedi, on Sep 4 2005, 01:56 PM, said:

what is the changes... i don't see anything new
<{POST_SNAPBACK}>

Quote

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:

This post has been edited by MHz: 03 September 2005 - 10:19 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy