Jump to content
Sign in to follow this  
successliwei

Runasset error: cannot execute external program

Recommended Posts

I want to install the wizip by users,so i have to use Runasset function

Code:

if NOT FileExists("c:\Program Files\WinZip\WINZIP32") THEN

if not IsAdmin() Then

RunAsSet("myadmininame","mydomain","mypassword",2)

RunWait("S:\winzip81.exe") ;s:\ is a network mapping driver,and everyone can access

Else

run("notepad")

run("s:\winzip81.exe")

EndIf

Else

Exit

EndIf

Error:Unable to execute external program

The system cannot find the path specified

Note:When i marked RunAsSet line(RunAsSet("myadmininame","mydomain","mypassword",2)),there is no error,but the winzip cannot be installed .because of no administrator prevliage

Share this post


Link to post
Share on other sites

The Map to S: is not available under the RunAs account credentials.

options:

1. Use the UNC to run the installler : \\servername\path-to-file\winzip81.exe

2. First do a FileCopy() to copy the file from the server to local disk and then run it with the orther credentials.

Jos

Share this post


Link to post
Share on other sites

I want to install the wizip by users,so i have to use Runasset function

You can use "autoit" in squared brackets to to make code appear in a easy to read fashion, see below :)

if NOT FileExists("c:\Program Files\WinZip\WINZIP32") THEN
    if not IsAdmin() Then
        RunAsSet("myadmininame","mydomain","mypassword",2)
                                RunWait("S:\winzip81.exe") ;s:\ is a network mapping driver,and everyone can access
    Else
                            run("notepad")
        run("s:\winzip81.exe")      
    EndIf
Else
    Exit
EndIfoÝ÷ ÙK¶4*Z¶®¢Ý=ÛOv±êïz½=ÚÈZ­í=Ú­OvÂ)ó5{ªºkjØ^®ØZ©¦v¸¯zW­µêȲë)yËm«mërêâ·'(×±¶Ì"µÈb׫}êÞ³­Ø^v¸¯zf©¦)à±ú+¶§{rêâ·'(×±µ.r¥uÈ^rKaÌ"¶®¶­sdbfÆTW7G2gV÷C·3¢b3#·vç¦æWRgV÷C²FVà ×6v&÷cBÂgV÷CµFW7BgV÷C²ÂgV÷C´ô²gV÷C²¤VÇ6P ×6v&÷CÂgV÷CµFW7BgV÷C²ÂgV÷CµFæ÷Bf÷VæBgV÷C²¤VæF`

... just before the line run("s:\winzip81.exe")

regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

The Map to S: is not available under the RunAs account credentials.

options:

1. Use the UNC to run the installler : \\servername\path-to-file\winzip81.exe

2. First do a FileCopy() to copy the file from the server to local disk and then run it with the orther credentials.

Jos

thanks

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  

×
×
  • Create New...