Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[SOLVED] After program runs, "Failed to Launch" di



  • Please log in to reply
4 replies to this topic
mikek
  • Members
  • 161 posts
  • Last active: Nov 09 2015 05:02 PM
  • Joined: 21 Nov 2008
Hello, I am experiencing a strange problem where after I run a compiled FoxPro program, an error dialog appears saying that the program failed to run. I can't figure out how to prevent it, so I thought I would make an ahk script to dismiss the dialog box. However, after the program runs, I get an ahk message saying the program failed to run. Any ideas what's going on? I understand this is not exactly an ahk issue, but I've always gotten friendly help in this forum, and figured it's worth asking.

Here's the ahk message:

Posted Image

Here's the ahk script:

run "C:\ahk\HIT List\hit_list.FXP"

SetTitleMatchMode 3 ; The title must match exactly
stWindowName := "C:\ahk\HIT List\hit_list.FXP"
WinWait, %stWindowName%, , 300
IfWinExist, %stWindowName% 
	{
	Send, {ENTER}
	}

Here's the dialog that appears after the program is run without using ahk:

Posted Image

- Mike

girlgamer
  • Moderators
  • 3263 posts
  • Last active: Feb 01 2015 09:49 AM
  • Joined: 04 Jun 2010
Try removing the "" around the name. Also check to see if the file exists with the exact name you specified. The only time you really need quotes around the name is when you try to run a file from dos that has spaces in the name or in the path.

When you try to run a file and get an error like this there are several possible causes. The possibilities are a) the path is wrong
B) the file name is wrong
c) the file doesn't exist
d) it is unrunnable because there is no association with the .fxp file manager.

The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ‚óŹ
MMO Fighter   KeyLooperDemo   Key Spammer   TinyClickRecorder  GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
Rock-on%20kitten.gif


mikek
  • Members
  • 161 posts
  • Last active: Nov 09 2015 05:02 PM
  • Joined: 21 Nov 2008
Thank you, girlgamer. I removed the quotes and am experiencing the same behavior.

It is definitely not a b or c. The thing is, the program does run. After it has run successfully and finished, then the dialog appears saying the program couldn't be found.

- Mike

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
✓  Best Answer
; Try something like this

run [color=red]c:\path\to\application\app.exe[/color] "C:\ahk\HIT List\hit_list.FXP" 



SetTitleMatchMode 3 ; The title must match exactly 

stWindowName := "C:\ahk\HIT List\hit_list.FXP" 

WinWait, %stWindowName%, , 300 

IfWinExist, %stWindowName% 

   { 

   Send, {ENTER} 

   }

return


mikek
  • Members
  • 161 posts
  • Last active: Nov 09 2015 05:02 PM
  • Joined: 21 Nov 2008
Nicely done, tomoe_uehara! Problem solved! Thank you so much. You're a rockstar!

- Mike