Jump to content
Sign in to follow this  
Riz

Help with Run external Program

Recommended Posts

I have got HELP file which is located at the same folder, but when i click the button always sad "Unable to execute the external program"

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Button_1 = GuiCtrlCreateButton("Button1", 150, 100, 100, 30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        Run(@ScriptDir & "\KHA.chm", "", @SW_MAXIMIZE)
    Case Else
    ;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites

you gotta run the help file viewer first then the help file as a command line argument. or use the dos "start" command then your help file then it should run.

Like this:

$file = @scriptdir & "\KHA.chm"

run("start " & $file)

Edited by spyrorocks

Share this post


Link to post
Share on other sites

you gotta run the help file viewer first then the help file as a command line argument. or use the dos "start" command then your help file then it should run.

Like this:

$file = @scriptdir & "\KHA.chm"

run("start " & $file)

Thanks for you fast reply but same problem

Share this post


Link to post
Share on other sites

are you sure your help file is there? are you able to view the help file when you click it?

Yes %100 i'm sure

Share this post


Link to post
Share on other sites

try thisa:

$helpfile = '"' & @scriptdir & '\KHA.chm"'

run("C:\windows\hh.exe " & $helpfile)

try that i think it should work.

Amzing, its works

thanks a lot for your help :P

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...