Jump to content

Shell Execute Workaround/Confusion?


OiMunk
 Share

Recommended Posts

This line works:    ShellExecute("notepad.exe","","C:\Windows\System32\")

This one doesn't:     ShellExecute("TotalMixFX.exe","","C:\Windows\System32\")

I get the error: "Windows Cannot Find...".     I've quadruple checked the spelling of "TotalMixFX.exe".

 

Similarly, this line works: Run("C:\Windows\System32\notepad.exe")

But this one doesn't:  Run("C:\Windows\System32\TotalMixFX.exe")

Nothing happens.

I can click on the icon normally, create shortcuts for it, check its properties, but AutoIt can't open it.   Ideas please?  Alternate methods of opening a file?

 

Edited by OiMunk
clarification
Link to comment
Share on other sites

MsgBox(0, "", "File exists: "&(FileExists("C:\Windows\System32\TotalMixFX.exe")?"Yes":"No"))

Check if the executable is located at the specified path. If yes, try running it with the cmd. If it launches successfully with cmd, and not with Autoit, maybe do something like:

RunWait(@ComSpec & " /c start C:\Windows\System32\TotalMixFX.exe")

 

Link to comment
Share on other sites

I am running Win7 x64/Win10 x32

On both systems i don't have "TotalMixFX.exe" within my system32 directory, and i have failed to get it on a virtual machine (win7 x64). So i was trying to help, but i have no way of troubleshoot on my end.

Link to comment
Share on other sites

Thanks All.

Update:  I can open the .exe from the Cmd line, but not AutoIt, or any other program that opens .exe files.  

I tried,  

RunWait(@ComSpec & " /c start C:\Windows\System32\TotalMixFX.exe")

 as suggested with no effect.

I do not have  #requireadmin.

I'm using Win7, 64bit.     The TotalMixFX.exe originates from an installer (It's the control software for a hardware audio interface).  I suspect, as suggested, that there's some security feature surrounding this file, but I'm not sure how to verify that, or circumvent it.  I did RightClick->Properties->Security on the file, and it appears that all "Permissions" are "Allowed".

I'm not sure how to "try"  C:\Windows\SysWOW64 as suggested above: the file is definitely in System32, not SysWOW64.

 

Interestingly, this line works perfectly in AutoHotKey   Run, C:\WINDOWS\System32\TotalMixFX.exe

 

Edited by OiMunk
Link to comment
Share on other sites

Are you compiling it as a 64bit app?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Will "TotalMixFX.exe" run, if a non assiciated AutoIt application is running in the background?

Maybe it's programmed to fail startup, if certain types of processes are running?

Link to comment
Share on other sites

Prodigy: The error returned from AutoIt says "Cannot find file".    TotalMixFX.exe runs perfectly when I manually run it.   The problem is that AutoIt can't find the file.    I actually have an AutoIt script running at all times.

Link to comment
Share on other sites

  • Developers

show me the SciTE oputput pane information when you run the script. Simply cut&paste the text into a codeblock in your reply.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Amazing!    That thread has the solution, even though it's absurd.

ShellExecute("TotalMixFX.exe")     ;   this works! because the .exe is in the system32 folder

and this will never work:  

ShellExecute("TotalMixFX.exe","","C:\Windows\System32\")   ;because the .exe is in the system32 folder...

Go figure.

Link to comment
Share on other sites

  • Developers

One other thing to remember is that the 3rd parameter is the workdir, not the path where to find the exe!

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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