HearingTech

Cannot Run Application from Network

9 posts in this topic

#1 ·  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.

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)

 

Share this post


Link to post
Share on other sites



#2 ·  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:

Spoiler

I will always thank you for the time you spent for me.
I'm here to ask, and from your response, I'd like to learn.
By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

Share this post


Link to post
Share on other sites

#3 ·  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()?

Share this post


Link to post
Share on other sites

#4 ·  Posted

11 minutes ago, HearingTech said:

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

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  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.

Share this post


Link to post
Share on other sites

#6 ·  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.

Share this post


Link to post
Share on other sites

#7 ·  Posted

Have you investigated using a silent installation so that you don't need to automate the install GUIs?

1 person likes this

Share this post


Link to post
Share on other sites

#8 ·  Posted

@Danp2

Most of the applications are proprietary and I have not heard back from the dev teams if they have any switches, others such as the AS400 are insane to automate.

Share this post


Link to post
Share on other sites

#9 ·  Posted

@HearingTech Good luck. Haven't worked with an AS400 in over 20 years!

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