Jump to content

To use a .bat or not to use a .bat?????


 Share

Go to solution Solved by dwaltosz,

Recommended Posts

so I am trying to get a file to copy from a net share to the desktop and over write the existing file. the file is .ini file that I need to update after an installation I have about 500+computers that need this I have the install automated butat the end need that file updated any suggestions? at the bottom is my attempt to get it to work but when I run it the last line does to GO but if I comment out all but that last line it will run just fine not sure if I am missing anything???? Please Help

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.12.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <Process.au3>


#RequireAdmin
run("\\REDMAN03\Installs\Dentrix\DentrixIntegrator-CD303b5\Engl-US\IntegratorClient\IntegratorClientUS.exe")
sleep(5000)
Local $hWnd = WinWait("DEXIS Integrator Client - InstallShield Wizard", "")
WinActivate($hWnd)
ControlFocus($hWnd, "", "Button1")
ControlClick($hWnd, "", "Button1")
WinWait("DEXIS Integrator Client - InstallShield Wizard", "")
WinActivate("DEXIS Integrator Client - InstallShield Wizard", "")
ControlClick("DEXIS Integrator Client - InstallShield Wizard", "", 1000)
ControlClick("DEXIS Integrator Client - InstallShield Wizard", "", 1)
WinWait("DEXIS Integrator Client - InstallShield Wizard", "")
WinActivate("DEXIS Integrator Client - InstallShield Wizard", "")
ControlClick("DEXIS Integrator Client - InstallShield Wizard", "", 1)
WinWait("DEXIS Integrator Client - InstallShield Wizard", "")
WinActivate("DEXIS Integrator Client - InstallShield Wizard", "")
ControlClick("DEXIS Integrator Client - InstallShield Wizard", "", 1)
WinWait("DEXIS Integrator Client - InstallShield Wizard", "")
WinActivate("DEXIS Integrator Client - InstallShield Wizard", "")
ControlClick("DEXIS Integrator Client - InstallShield Wizard", "", 1)
Sleep(9000)
WinWait("DEXIS Integrator Client - InstallShield Wizard", "")
WinActivate("DEXIS Integrator Client - InstallShield Wizard", "")
ControlClick("DEXIS Integrator Client - InstallShield Wizard", "", "Button4")
Sleep(5000)
run("msiexec /i \\redman03\installs\TSScan\Client\TSScanMSI.msi")
WinWaitActive("Open File - Security Warning", "")
ControlClick("Open File - Security Warning", "", 4426)
Run(@ComSpec & ' /c \\REDMAN03\Installs\Dentrix\DentrixIntegrator-CD303b5\Engl-US\IntegratorClient\INI.Bat', "", @SW_HIDE)
Link to comment
Share on other sites

  • Moderators

Why not use InstallShield's silent install and others switches which would bypass all the clicks?

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

I had one of the software engineers at my work help me with the installshield's silent install before trying this and we ran into some snags and could not get it to work and we were spending more time then it was worth so I moved to using autoit I got the install working just fine just need to update a .ini file after the install that is all I am running into a problem with.

Link to comment
Share on other sites

I don't know whether English is your native language, but it really helps if questions are worded properly (that care is taken).

I'm presuming that

 

does to GO

 

actually means "doesn't go"?

It may help us to know the content of your INI.bat file.

Do you know for sure that it doesn't run?

Or is it just not giving the results you expect?

I think it is fairly safe to say, that if it runs on its own with the prior lines commented out, then it is probably running.

That's taking for granted, that it exists already at the run location.

It could well be just a timing issue, which might be apparent if we knew the commands you use in the INI.bat file.

I'm presuming, that certain things need to have finished, before the INI.bat file runs?

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • Solution

sorry for the bad typing I get typing fast and miss a few letters or words in there but any who I figured it out... at the end of my code I had a winwaitactive and that was holding the whole thing up it was waiting tell the window was active but it had already done what it needed to do. after I changed it to winactivate it ran without a hitch. thanks all for your help and imput.

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