Jump to content

Attemptting to start a program not working


deanP
 Share

Recommended Posts

2 minutes ago, deanP said:

Hi Matt,

 

Yes the path is correct, as copied from properties. "C:\Program Files\3SpaceSensor\3SpaceSuite.exe"

Wow.  It just wants to be a stubborn little bugger huh.  Ok, lets try this:

  • Does your system use a x86 or x64 architecture?  (right click "computer" or "my computer" from start menu and select properties, info located with os info).  If you are using a x64, in the same window in which you enabled the script to launch with admin permissions, stay on the Autoit3/Aut2exe tab and uncheck "compile as x86" and check "compile as x64".
  • Try editing the shellexecute and run commands to look like this:
    • Run( @Comspec & " /c 3SpaceSuite.exe", "C:\Program Files\3SpaceSensor" )
    • ShellExecute (  "3SpaceSuite.exe", "", "C:\Program Files\3SpaceSensor" )
Link to comment
Share on other sites

7 minutes ago, deanP said:

Hi Matt,

 

Not knowing any better it does appear that the file is starting to open per seeing the two processes names after the program opening; the same two that open when I click to open the program.  Thus it seems the start of the Script is causing the file to start to open; and it seems something is stopping this as its on its way to opening.

 

Don't get me wrong.  I hear what you are saying, but I have never heard or experienced anything like that before.  If the process are launching successfully, then unless you put in your script to close them, they shouldn't be closing.  Thats why I wanted you to check the Properties for the applications shortcut, to ensure there wasn't some argument that it passes to the exe it calls to make it work correctly.  It might help if you posted a snapshot of the shortcut property dialog box so i can see too.

Edited by MattHiggs
Link to comment
Share on other sites

Hi Matt,

 

Running 32 bit system.

I also just tried both of your script ideas and they both worked!  You are a very smart person, thank you for hanging in there and thinking through this and drilling down on the solution. If you would not mind can you briefly explain how you divined the idea to build the path as you did?

 

Thanks again for devoting your time toward getting this issue resolved.

 

DeanP

Link to comment
Share on other sites

I thought I had gone through all permutations of the help directory and the blog suggestions on how to use Run and ShellExecute , I must have missed doing it the correct way or was so tired when I hit upon it working correctly that  I missed it, and kept right on trying different things. Have to say thanks one more time!

 

DeanP

Link to comment
Share on other sites

2 minutes ago, deanP said:

Hi Matt,

 

Running 32 bit system.

I also just tried both of your script ideas and they both worked!  You are a very smart person, thank you for hanging in there and thinking through this and drilling down on the solution. If you would not mind can you briefly explain how you divined the idea to build the path as you did?

 

Thanks again for devoting your time toward getting this issue resolved.

 

DeanP

Sure dude.  All I did was call the file itself without its path as the main file to execute.  Then, if you look at both the Run and ShellExecute functions in the help file, you will see that I put the path for the directory which contains the executable which you were trying to run as the working directory parameter.  So essentially, I told the function "I want you to run this file.  It is in this folder."  Rather than what we were doing before "I want you to run 'the entire path to this file'".  I will look in my default folder for that file."  Does that make sense?

Link to comment
Share on other sites

4 minutes ago, deanP said:

I thought I had gone through all permutations of the help directory and the blog suggestions on how to use Run and ShellExecute , I must have missed doing it the correct way or was so tired when I hit upon it working correctly that  I missed it, and kept right on trying different things. Have to say thanks one more time!

 

DeanP

No prob man.  Anytime.

Link to comment
Share on other sites

Just now, deanP said:

Very good explanation, Yes that makes sense.

 

Thanks again,

Also, how long have you been a programmer just curious on your background; and it will add to when I tell this story.

Believe it or not, I am still a student.  College of course.  Finishing up my last couple of classes for my bachelors in Information Technology.  I have been using autoit for about 2 years now, and it is by far my favorite scripting language.  After my first internship in which I got a taste of what working in IT was like, I loved it.  Since then, I have been teaching myself more about applying IT principles in enterprise environments by setting up my own domain controller, web server, and applying new IT concepts I discover to my environment (but makes my room hotter than the deepest pit in hell!).  But I particularly love scripting, just because it allows us to develop ways to make computers do the bulk of the work much faster than we could hope to do manually.  And isn't that the whole point of having computers?  When I see technology becoming more of a hindrance than benefit, and nobody seems to care, that is a personal pet peeve of mine.  But anyhow, thats me.

Link to comment
Share on other sites

Well I must say your obvious dedication to your studies and your teaching yourself have really made you an excellent programmer.  I think being an expert at programming is one thing but being able to converse, at distance, with someone not that skilled, and me not likely defining the problem well, speaks to your skill. I think some other quality attributes you seem to have are patience, persistence and an ability to not get frustrated with people who are not on your level of understanding. 

Thanks again.

Link to comment
Share on other sites

2 minutes ago, deanP said:

Well I must say your obvious dedication to your studies and your teaching yourself have really made you an excellent programmer.  I think being an expert at programming is one thing but being able to converse, at distance, with someone not that skilled, and me not likely defining the problem well, speaks to your skill. I think some other quality attributes you seem to have are patience, persistence and an ability to not get frustrated with people who are not on your level of understanding. 

Thanks again.

Well that is my job too.  I work as an IT support engineer, and this is one of the many aspects of my job I do every day.  But I appreciate the complement nonetheless.  

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...