Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

LaunchApp question


1 reply to this topic

kvsasi

kvsasi
  • Members
  • 8 posts

Posted 22 November 2002 - 22:34

When I type a text file's name in a command line in WinNT4.0 (e.g. c:\>abc.txt), the file gets opened in Notepad.exe. Hence I thought that the method call

LaunchApp ("c:\abctxt", "")

will open c:\abc.txt in notepad.exe. But this doesn't happen.

I was trying this because I didn't want to hardcode Notepad.exe application in LaunchApp method, because someone could have removed it from their system.

What am I doing wrong?

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 23 November 2002 - 00:12

It's highly unlikely that someone will have removed it from their system, so to resolve your problem, use LaunchApp("notepad.exe", "c:\abc.txt").  Since notepad.exe is in the path, it should be automatically launched.

Worst case though, you can just prepend "notepad.exe" with WINDIR ^, so it's not hard coded and will match the user's configuration.

Another option is to always just use whatever program TXT file are associated with, but this takes more work and sound like a bit of a novice to IS, I'll pass on explaining it.
user posted image