RajeshK Posted August 4, 2018 Posted August 4, 2018 (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 August 4, 2018 by RajeshK
Developers Jos Posted August 4, 2018 Developers Posted August 4, 2018 Are you sure the path is correct as indicated? or should that be : C:\ProgramData\Microsoft\Windows\Menu Start\Programs\7-Zip\7-Zip File Manager.exe" 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.
RajeshK Posted August 4, 2018 Author Posted August 4, 2018 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"
Subz Posted August 5, 2018 Posted August 5, 2018 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")
AdamUL Posted August 6, 2018 Posted August 6, 2018 This is due to the x86 redirection. If you need to run it as 32 bit, add the following to the top of your script. ;Disable x86 redirection mechanism for a 32-bit script. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) Adam
Subz Posted August 6, 2018 Posted August 6, 2018 @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.
LisHawj Posted August 7, 2018 Posted August 7, 2018 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.
Subz Posted August 8, 2018 Posted August 8, 2018 @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
LisHawj Posted August 8, 2018 Posted August 8, 2018 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.
Subz Posted August 8, 2018 Posted August 8, 2018 It looks like an issue with the 7-Zip msi version, installing exe version, shortcut opens fine.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now