Jump to content

Recommended Posts

Posted (edited)

I have a requirement to run the shortcut 

To capture the shortcut, I am getting the path from "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" and then identify the application folder, open the folder and then launch all the shortcuts available in that folder

ShellExecute("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\7-Zip\7-Zip File Manager.exe")

above line is my code which is not launching the shortcut but says that specified path does not exist.

Need inputs

Edited by RajeshK
Posted

Yes thats the correct path. In my first post I specified as exe, it should be .lnk like below

"C:\ProgramData\Microsoft\Windows\Menu start\Programs\7-Zip\7-Zip File Manager.lnk"

  • RajeshK changed the title to Unable to run shortcut with ShellExecute or with Run
Posted

For some reason AutoIt is translating the file path to 32bit so even though the shortcut reads "C:\Program Files\7-Zip\7zFM.exe" its translating it to "C:\Program Files (x86)\7-Zip\7zFM.exe", which doesn't exist.

Local $aShortCut = FileGetShortcut(@ProgramsCommonDir & "\7-Zip\7-Zip File Manager.lnk")
ConsoleWrite($aShortCut[0] & @CRLF)

If you use something like below it works fine

#AutoIt3Wrapper_UseX64=y
ShellExecute(@ProgramsCommonDir & "\7-Zip\7-Zip File Manager.lnk")

 

Posted

@AdamUL Tried that before I posted above and that doesn't work either, as I mentioned it appears to be translating the path as a variable i.e. %ProgramFiles% although the shortcut has full path to the 7-Zip.exe.

Posted

I am using the same code above and don't have issue launching the shortcut links from the exact location.  Just to be sure I even added another shellexecute to run the AutoIT check for updates.  See pic below.

image.thumb.png.126d4896f9aeee0a6d7d9e80478ff368.png

 

Posted

@LisHawj Strange have exactly the same version, Check for Updates and other applications open fine, both 32/64 bit, just not 7-Zip, what 7-zip version do you have, was it Msi or Exe version?  I have 18.05 msi version on Windows 10 Enterprise 1709 x64

Posted

I am running Win10 Pro x64 v1803 and 7zip is version 18.05 x64 in .exe that I downloaded from the 7zip website just for this test.  My AutoIT version is 3.3.14.5 and SciTE 
Version 4.1.0, Jun 27 2018 21:46:27.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...