Jump to content

Break In Script Befor Filedelete


tobi
 Share

Recommended Posts

Hi...

i want to make auto-installation.

after the installation is complete i want to remove the installation file from the local harddisk but

the file is left there every time.

maybe the installtion process will not be unloaded so fast and the file is in still in use when

the script tries to delete it.

Winwaitdelay seems not to work...

Can you give me some ideas...?

thx in advance

Tobi

RunAsSet("***", "%Computername%","***")

FileCopy("K:\***\owc11.exe", "d:\")

Run ("D:\owc11.exe")

WinWaitActive ("Microsoft Office 2003 Web Components Setup", "To continue with Office")

Send ("!a")

Send ("!i")

WinWaitActive ("Microsoft Office 2003 Web Components Setup", "Microsoft Office 2003 Web Components Setup has completed successfully.")

Send ("{ENTER}")

AutoItSetOption ("WinWaitDelay",5000)

FileDelete("D:\owc11.exe")

RunAsSet( )

Link to comment
Share on other sites

  • Moderators

If this is your own (AutoIt written) Setup File... you could look at _SelfDelete() (in SciTe type in _SelfDelete and then spacebar), and OnAutoItExit().

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hi smoke...

i cannot find something about _selfdelete.. could you give me a little bit more information about it please ?!

do you have an idea why the command FileDelete("D:\owc11.exe") doesnt work in my script ?

br Tobi

Link to comment
Share on other sites

Just try to monitor the PID and delete it when it is closed.

RunAsSet("***", "%Computername%","***")
FileCopy("K:\***\owc11.exe", "d:\")
$pid = Run ("D:\owc11.exe")
WinWaitActive ("Microsoft Office 2003 Web Components Setup", "To continue with Office")
Send ("!a")
Send ("!i")
WinWaitActive ("Microsoft Office 2003 Web Components Setup", "Microsoft Office 2003 Web Components Setup has completed successfully.")
Send ("{ENTER}")
AutoItSetOption ("WinWaitDelay",5000)
ProcessWaitClose($pid)
FileDelete("D:\owc11.exe")
RunAsSet( )

Note: selfdelete is the Scite4AutoIt3 abbreviation

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...