Jump to content

Combined Script Doesn't Work


MFate
 Share

Recommended Posts

I have a script that installs some software and then does some cleanup afterwards. The software installation part works fine but the cleanup part doesn't work. When I separate the scripts into individual files and run them individually, everything works fine. The combined script is shown here. Any help would be greatly appreciated.

; Install ScriptPro

RunWait ("P:\zInstall\Support\ScriptPro\CDROM1\Setup.exe /qn")

WinWaitActive ("ScriptPro", "Please wait while Windows configures ScriptPro")

WinWaitClose ("ScriptPro", "Please wait while Windows configures ScriptPro")

; Do some cleanup

DirRemove ("C:\Documents and Settings\All Users\Start Menu\Programs\Autodesk\ScriptPro", 1)

FileCopy ("P:\zInstall\Support\ScriptPro\ScriptPro.lnk", "C:\Documents and Settings\All Users\Start Menu\Programs\Autodesk\ScriptPro.lnk", 9)

Link to comment
Share on other sites

try adding like a 2-3 second sleep in between, if the rest of the script runs as soon as the window closes then the files might still act as if they were still being run by the program and they cant be deleted.

Link to comment
Share on other sites

try adding like a 2-3 second sleep in between, if the rest of the script runs as soon as the window closes then the files might still act as if they were still being run by the program and they cant be deleted.

I tried your suggestion and even extended the time to 1 full minute, however it did not work.

Sleep (60000)

Link to comment
Share on other sites

  • Moderators

The DirRemove and the FileCopy portion of the script do not work inside of the main script which is shown at the top of this thread

Do you have permissions to do it?

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

Do you have permissions to do it?

Yes I have permissions.

I have a script that installs some software and then does some cleanup afterwards. The software installation part works fine but the cleanup part doesn't work. When I separate the scripts into individual files and run them individually, everything works fine. The combined script is shown here.

; Install ScriptPro

RunWait ("P:\zInstall\Support\ScriptPro\CDROM1\Setup.exe /qn")

WinWaitActive ("ScriptPro", "Please wait while Windows configures ScriptPro")

WinWaitClose ("ScriptPro", "Please wait while Windows configures ScriptPro")

; Do some cleanup

DirRemove ("C:\Documents and Settings\All Users\Start Menu\Programs\Autodesk\ScriptPro", 1)

FileCopy ("P:\zInstall\Support\ScriptPro\ScriptPro.lnk", "C:\Documents and Settings\All Users\Start Menu\Programs\Autodesk\ScriptPro.lnk", 9)

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