Jump to content

Recommended Posts

Posted

I'm new to AutoIT, but have some basic scripting/programming understanding, so the concepts and basic logic is easy for me to grasp, and I have double checked that I am using AutoITv3.  I've been working on automating a chunk of my company's rollout and while I can get it to work with local files it doesn't work with networked files.  I cannot run the script off a network share as it throws the generic error:

  Quote

Line 0 (File "filepath"): Error: Error opening the file.

Expand  

The other problem is that if I am to use local files it would have to be on a flash drive as copying data from the network down would take too long as it's close to 10GB of data.  The beginning of my script looks like this:

; Script Start - Add your code below here

#RequireAdmin
#include <MsgBoxConstants.au3>
#pragma compile(inputboxres, true)

;--------------------------------------------------------------------------------------------
;Begin Installation of WSPw
;--------------------------------------------------------------------------------------------
;Run ("C:\...\setup.exe") ;Local
;Run ("setup.exe", "W:\...\install") ;Network
;Run (@ScriptDir & ".\...\setup.exe") ;Run From Network
Run ('\\IP\...\setup.exe')

WinWait ("WSPw - InstallShield Wizard", "&Next >")
WinActivate ("WSPw - InstallShield Wizard", "&Next >")
ControlClick ("WSPw - InstallShield Wizard", "&Next >",2081)

 

Posted (edited)

@HearingTech

Hi and welcome to the AutoIt forum :)

Did you try the ShellExecute() function instead of the Run() function? What's the result? 

Always check with

If @error Then
    ; Some Code to display handle the error
Else
    ; Some Code to continue the script
    ; ...
EndIf

:) 

EDIT:

I just tried with ShellExecute(), and it works :) 

Edited by FrancescoDiMuro

Click here to see my signature:

  Reveal hidden contents

 

Posted

@FrancescoDiMuro

Thank you for the help that did fix part of the problem!  It looks like ShellExecute() is working, however it pauses/crashes the script as it requires credentials mid run.  Is there a way to do ShellExecute() as you can RunAs()?

  • Developers
Posted
  On 7/26/2017 at 4:29 PM, HearingTech said:

Is there a way to do ShellExecute() as you can RunAs()?

Expand  

RunAs()?  That is not what you've shown above and likely is the issue in the first place.
These credentials you use in the Runas() are they a local account or domain account? 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

@Jos

The script above did not need to run using RunAs() being that I was running everything local.  The script calls for admin rights on start, but the issue is that it requires 2 sets of rights, the first is domain admin rights to install on the computer and the second is rights for the mapped drive.  If this would work with a single sign-on from a flash drive I can set that up as well.

Posted

@FrancescoDiMuro @Jos

So I've been working on this all day alongside all of my other tasks at the office.  I've found that ShellExecute() is able to run without issue if the script is on the desktop and the data is on a flashdrive.  At this point that is good enough for this deployment, as we have 128GB flash drives, which can handle the data size for all of the installers required.  So my next issue is dealing with automating the applications that have combo and list boxes, as well as require user input (names/paths/etc) and then building a GUI to run only specific applications this way each department gets only their specific installations.  Thanks for your help, I'll create another posting if I run into issues with the GUI or applications, such as the AS400 which I know will cause issues.

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