Jump to content

Can An Autoit Script Be Scheduled To Run?


Guest lostarnes
 Share

Recommended Posts

Guest lostarnes

I wrote a small script to answer the prompts generated by WinZip when opening a self-extracting file. It worked great. I would like to schedule this to run at night either with the task scheduler or using PSEXEC form anothe machine. This fails. I assume its because there are no "windows" generated for AutoIt to work with? Is there a way around this? Or do I need another tool?

Run("c:\ptc\test.exe")

WinWaitActive("WinZip Self-Extractor - test.exe", "", 5)

; Send Unzip

Send("!u")

; Prompt saying files unzipped, OK

WinWaitActive("WinZip Self-Extractor")

; Send OK

Send("{ENTER}")

; Original Winzip window

WinWaitActive("WinZip Self-Extractor - test.exe")

; Send Enter to close

Send("{ENTER}")

WinWaitClose("WinZip Self-Extractor - test.exe")

Link to comment
Share on other sites

Guest lostarnes

That works but you have to have the command line add-on installed on the remote workstations. I tried just copying the WZUNZIP exe over but it wanted some dll's.

Link to comment
Share on other sites

use controlsend, you will have to find the name of the control most likely, but you could try it without, like:

Run("c:\ptc\test.exe")
Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=...
WinWait("WinZip Self-Extractor - test.exe", "", 5)
ControlSend("WinZip Self-Extractor - test.exe","","","!u")
WinWait("WinZip Self-Extractor")
ControlSend("WinZip Self-Extractor","","","{ENTER}")
WinWait("WinZip Self-Extractor - test.exe")
ControlSend("WinZip Self-Extractor - test.exe","","","{ENTER}")

I would look for an actual control, and the winwait might not work, but this is a start.

You could also fileinclude the extractor in the autoit exe

look at 7zip's extractor. Fast free, and I think the command line only needs the exe.

...edit forgot to give URL

http://www.7-zip.org

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

  • Administrators

Is my english so poor or this sentence is quite meaningless? :huh2:  :D

I think it's you :)

god i am so outta touch. still using pkunzip...

god = oh dear

i am so outta touch = I am not familiar with current technology

still using pkzip = still using pkzip

:)

Edit: "out of touch" maybe a phrase with no direct translation :lol:

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...