Jump to content

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

Link to comment
Share on other sites

  • Developers

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

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

Link to comment
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!

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...