Jump to content

Run fails on txt or chm files


Recommended Posts

Why does this fail unless I include "notepad.exe"?

FAILS:

Run("C:\WINDOWS\system32\Help.txt", @SystemDir)

FAILS:

Run(@SystemDir & "\Help.txt", @SystemDir)

SUCCEEDS:

Run("notepad.exe C:\WINDOWS\system32\Help.txt", @SystemDir)

SUCCEEDS:

Run("notepad.exe" & @SystemDir & "\Help.txt", @SystemDir)

Same thing with CHM files. I wouldn't mind if I knew what to use in place of "notepad.exe" when trying to run a chm file instead of a txt file.

My real concern is running the chm files. The txt files were just for testing.

Any suggestions would be greatly appreciated!

-Steve

Link to comment
Share on other sites

i think you can attempt to run any file by typing this

Run ( "run " & file-to-run )

edit: i was wrong, its

Run ( @ComSpec & " /c start " & file-to-run )

example:

Run ( @ComSpec & " /c start http://www.autoitscript.com", "", @SW_HIDE )

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

To answer you original question (why): http://www.autoitscript.com/autoit3/docs/faq.htm#6

Alternative to Xenogis' answer and what goes in place of notepad.exe:

Run('hh.exe "C:\Program Files\AutoIt3\AutoIt.chm"')

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...