Jump to content
Sign in to follow this  
Guest lostarnes

Can An Autoit Script Be Scheduled To Run?

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
scriptkitty

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.

Share this post


Link to post
Share on other sites
Somerset

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


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites
ezzetabi

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

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

Share this post


Link to post
Share on other sites
Jon

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:

Share this post


Link to post
Share on other sites
ezzetabi
: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:

Share this post


Link to post
Share on other sites
Somerset

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.


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.