Sign in to follow this  
Followers 0
Champak

Unable To Open File

12 posts in this topic

I'm unable to run a prgram. I've never used these files before so I don't know the root exe file to run it, I'm assuming the file itself is the exe file. It is in a compiled HTML help format. What I'm using to launch it is...

Run("NAM.chm")

When I check to see what it opens with, I see "Microsoft HTML Help Executable". But what and where is that on an XP system?

Is there a root exe file I should be calling with it? If so, what is the program that is actually used to launch it?

....I hope I'm making sense

Share this post


Link to post
Share on other sites



You can't do it quite like that.

Try this:

Run(@COMSPEC & ' /c "c:\your path\NAM.chm"','',@sw_hide)

Share this post


Link to post
Share on other sites

Try

#include <Process.au3>
$rc = _RunDos("start NAM.chm")


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Run('hh.exe NAM.chm')

Share this post


Link to post
Share on other sites

Thanks all. I went with door number 3 because a lot of my other code is done like that. I'm always a little skeptical/wary when there are multiple ways to code something. Is there a reason for the other ways...proper coding....redundancys or something.

Share this post


Link to post
Share on other sites

hh.exe is something used by AutoIt to launch helpfiles, I think the hh stands for Helpfile Handler/Helper, or something like that. Basically all the hh.exe does is what the prior two gents gave, except it accepts a parameter on launch for ease of use.


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites

I didn't want to start a new thread for an old issue so I posted here. After extensive searching and trying all the examples I found, I still can't open a .chm file from an AutoIt script, unless I hardcode the path, but I need to use an environment variable in place of hardcoding the path to the .chm file.

If I type "hh.exe %CD%\App\pk.chm" from a cmd window, it works fine, but if called from a script, I get an error saying it can't find the path. I've also tried the following, which also does not work (same error).

$help = @ScriptDir & "\App\pk.chm"
Run("hh.exe $help")

This is for a portable app so I don't want to use any 3rd party tools and I really don't want to resort to using a batch file and calling it from the script.

Does anyone know how to solve this?

Share this post


Link to post
Share on other sites

$help = @ScriptDir & "\App\pk.chm"
Run("hh.exe " & '"' & $help & '"')


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thank you very much. It works great. Now that I see it, I'm kicking myself.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Simple UDF:

Func _OpenHelp($file)
       Run("hh.exe " & '"' & $file & '"')
EndFunc

Three liner!

Edited by AutoItKing

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites

Simple UDF:

Func _OpenHelp($file)
       Run('hh.exe' & $file)
EndFunc

Three liner!

In your mad rush to write a "three liner" you forgot the most important part, making sure it works.

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