Sign in to follow this  
Followers 0
jacky_ckw

external program

14 posts in this topic

hi,

was searching and found this topic but i still cant get my program to install...

i have this line in my script

runwait("z:\viewer5\setup.exe")

got an error: unable to execute the external program.

the system cannot find the path specified.

anyone able to help?

thanks


New to script...But getting the hang of it.

Share this post


Link to post
Share on other sites

I've not had any trouble running from network drives.... Does "z:\viewer5\setup.exe" work if you try it form the Start > Run dialog?

I recommend trying the latest AutoIt beta http://www.autoitscript.com/autoit3/files/beta/autoit/

Also try the commands

MsgBox(0, "z: mapping is", DriveMapGet("z:"))

and

FileExists ( "z:\viewer5\setup.exe" )


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Working directory


Were ever i lay my script is my home...

Share this post


Link to post
Share on other sites

I've not had any trouble running from network drives....  Does "z:\viewer5\setup.exe" work if you try it form the Start > Run dialog?

I recommend trying the latest AutoIt beta http://www.autoitscript.com/autoit3/files/beta/autoit/

Also try the commands

MsgBox(0, "z: mapping is", DriveMapGet("z:"))

and

FileExists ( "z:\viewer5\setup.exe" )

<{POST_SNAPBACK}>

yes it does run from the start, run

did included a file check before executing, did not copy and paste from my script, just based on memory its something like tat...

---

if fileexists ("z:\viewer5\setup.exe") then

runwait("z:\viewer5\setup.exe")

else exit

---

if there is any error on my script here i have to copy and paste the original code that i typed... :idiot:


New to script...But getting the hang of it.

Share this post


Link to post
Share on other sites

Working directory

<{POST_SNAPBACK}>

emm... i dont get u... :idiot:

New to script...But getting the hang of it.

Share this post


Link to post
Share on other sites

I think you need to post the actual script for us to double check. The example you gave should work fine if the FileExists is working.

Share this post


Link to post
Share on other sites

Tip:

Open the help file once in a while. It contains syntax for all the functions.

With examples.

The working directory is a parameter you can choose to use for the Run/RunWait function.

Share this post


Link to post
Share on other sites

Tip:

Open the help file once in a while. It contains syntax for all the functions.

With examples.

The working directory is a parameter you can choose to use for the Run/RunWait function.

<{POST_SNAPBACK}>

i use the help file everytime cos im still learning from there! :idiot:

i will post my script here when i get back to office tomorrow Chris_1013 :D


New to script...But getting the hang of it.

Share this post


Link to post
Share on other sites

here is my source code...

#comments-start

setup Viewer 5

#comments-end

AutoItSetOption("TrayIconHide", 1)

$var = DriveStatus( "z:\" )

MsgBox(0,"Status", "Map drive as Z: status is " & $var)

If $var = "INVALID" Then Exit

If FileExists("z:\Viewer5\setup.exe") Then

RunWait(@ComSpec & " /c " &"z:\Viewer5\setup.exe", "")

MsgBox(0, "Restart", "Before launching the installed application, please restart your computer after installation", 6)

Else

MsgBox(0,"Error", "Setup.exe does not exist in Z:")

EndIf


New to script...But getting the hang of it.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Since the file you're trying to execute is an .exe, you don't need to go through ComSpec.

Try using this instead:

RunWait("z:\Viewer5\setup.exe")

It's also possible that the Working Directory you were specifying (the second parameter, you had an empty string) was part of the problem. So you could also try this:

RunWait("z:\Viewer5\setup.exe", "z:\Viewer5\")

*Edit: Hey, I'm an advanced member now! Woot!

Edited by Saunders

Share this post


Link to post
Share on other sites

Since the file you're trying to execute is an .exe, you don't need to go through ComSpec.

Try using this instead:

RunWait("z:\Viewer5\setup.exe")

It's also possible that the Working Directory you were specifying (the second parameter, you had an empty string) was part of the problem. So you could also try this:

RunWait("z:\Viewer5\setup.exe", "z:\Viewer5\")

*Edit: Hey, I'm an advanced member now! Woot!

<{POST_SNAPBACK}>

hi advance member Saunders,

i tried to use your

RunWait("z:\Viewer5\setup.exe", "z:\Viewer5\")

but still cannot...

i keep having this error: unable to execute the external program, the system cannot find the path specified.

thanks anyway... any other methods? :idiot:


New to script...But getting the hang of it.

Share this post


Link to post
Share on other sites

Hmm, I stumbled upon this thread: http://www.autoitscript.com/forum/index.ph...wtopic=2635&hl=

I wonder if this a Windows problem or an AutoIt problem (or both)....

I wonder if it matters how the drive is mapped? Do you use Novell, or Active Directory, or other?

By the way, does RunWait support UNC paths like \\server\share\file.exe ?


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

darn! my bloody script worked on W2K but not on WinXP just like what the other guys are having problems with. :idiot:

so that means that there is nothing wrong with my script, just that somehow it didnt work on WinXP.

well, i think we can only leave it to the next version of autoit which might be able to deal with this. :D


New to script...But getting the hang of it.

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