Sign in to follow this  
Followers 0
jfcby

[RESOLVED] Program want run

3 posts in this topic

#1 ·  Posted (edited)

Hi,

The script I'm using with AutoIT3 v3.2.12.1 is below that I compiled into an exe. If I run the script from SciTe or compile it and double click on the program exe icon it will run right.

But, If I try to run exe program from inside another Autoit3 script it will not run right.

The Script is suppose to run the Connecting to map networkdrive dialog box:

ConnectingToMapNetworkDrive.bmp

#include <_XMLDomWrapper.au3>

; Map Network Drive v1.0.0
; This is Program 2 which also needs program 1 
; Program 2 only runs the Signin form to map the network drive specified in program 1.

$file = "files/settings.xml"

    LoadInputSettings() 
    Exit
    
Func LoadInputSettings()    
    If FileExists($file) Then
            $ret = _XMLFileOpen ($file)
            if $ret =0 then Exit                
            
            ; Get count of item nodes in menu
            $iItems = _XMLGetNodeCount("/fields/field")         
            $iDrive = _GetFirstValue("/fields/field[" & 1 & "]/value")
            $iPath = _GetFirstValue("/fields/field[" & 2 & "]/value")
            ; Insert value into inputbox
            
            ; Disconnect Map Network Drive
            DriveMapDel($iDrive)
            Sleep(2000)
            ; Map Z drive to \\myserver\share using the domain\usrname with password
            DriveMapAdd($iDrive, $iPath, 8, "", "")
            Sleep(2000)         
            Return 1
    EndIf
    Return 0    
EndFunc   ;==>LoadSettings

;Get the first real value returned from the _XMLGetValue() return array.
Func _GetFirstValue($node)
    $ret_val = _XMLGetValue($node)
    If IsArray($ret_val) Then
        Return ($ret_val[1])
    Else
        Return SetError(1,3,0)
    EndIf
EndFunc     ;==_GetFirstValueoÝ÷ Ù8b²+-ë®*m#f¶¼¢h®éíç(¥yÚk¢
Ú­©ÝÝý²z-ÂäxºÚ"µÍÚ[^XÝ]J ][ÝÙ[ÉÌLÔÒUÒ[ÚË^I][ÝÊ

Thank you for your help,

jfcby

Edited by jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites



try

$file = "files\settings.xml"

or

$file = @ScriptDir & "\files\settings.xml"

instead of

$file = "files/settings.xml"

Thank you Zenda. I overlooked that simple error must be where I've been looking at code for so long.

Thank you for your help,

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

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
Sign in to follow this  
Followers 0