Jump to content

Can An Autoit Script Be Scheduled To Run?


Recommended Posts

Guest lostarnes
Posted

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")

Guest lostarnes
Posted

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.

Posted (edited)

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.

  • Administrators
Posted

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:


 

Posted
:D " All hail to Him good Jon He who creates AutoIt and helps us with our jobs." :huh2: "All hail to Jon that also helps us understanding slang" :) "Good Jon, we all love you..." :lol:
Posted

pkzip -> PKWARE introduced PKZIP in 1989, for DOS.

outta touch - > Meaning i am still using commandline 16bit tools, made for dos.

:D - > means that i am not giving them up any time soon.

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
  • Recently Browsing   0 members

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