ur Posted April 5, 2017 Posted April 5, 2017 I am trying to launch a shortcut. But I am getting a file not found error. Even I kept a condition to check the file exist and it is there but still I am getting the below error on run command. $release = "r10.0" $bit = "64" $erwinShortcut = @ProgramsCommonDir&"\erwin\erwin Data Modeler "& $release &" ("& $bit &"-bit)\erwin Data Modeler "& $release &" ("& $bit &"-bit).lnk" Run(@ComSpec & " /c """& $erwinShortcut &"""", @TempDir, @SW_HIDE) [Window Title] C:\ProgramData\Microsoft\Windows\Start Menu\Programs\erwin\erwin Data Modeler r10.0 (64-bit)\erwin Data Modeler r10.0 (64-bit).lnk [Content] C:\ProgramData\Microsoft\Windows\Start Menu\Programs\erwin\erwin Data Modeler r10.0 (64-bit)\erwin Data Modeler r10.0 (64-bit).lnk The specified path does not exist. Check the path, and then try again. [OK] Any suggestions? Even I tried surrounding with both double and single quotes for the path of lnk. And even changed the working directory to startmenu folder and also exe folder.
jguinch Posted April 5, 2017 Posted April 5, 2017 try @ProgramFilesDir instead of @ProgramsCommonDir Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
ur Posted April 5, 2017 Author Posted April 5, 2017 Hi @jguinch Thanks for the inputs. I tried the option you mentioned, but still same issue.
jguinch Posted April 5, 2017 Posted April 5, 2017 Sorry, I didn't see the C:\ProgramData in the text. So @ProgramsCommonDir should work. And what happens when you use Run(@ComSpec & " /k """& $erwinShortcut &"""", @TempDir) ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
jguinch Posted April 5, 2017 Posted April 5, 2017 The shortcut (.lnk) seems to be issue. Does the .lnk works manually ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
ur Posted April 5, 2017 Author Posted April 5, 2017 yeah, even it works when I run the command cmd /c or /k from commadn prompt. But issue with AutoIT
iamtheky Posted April 5, 2017 Posted April 5, 2017 (edited) turn off wow64 redirection? https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_Wow64EnableWow64FsRedirection.htm Edited April 5, 2017 by iamtheky ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
ur Posted April 5, 2017 Author Posted April 5, 2017 thanks @iamtheky It is working if I add the below lines. #include <WinAPIFiles.au3> $bEnable = False _WinAPI_Wow64EnableWow64FsRedirection ( $bEnable ) But don't know how it is related here as the Programdir is not a 32 or 64 bit folder.
Subz Posted April 5, 2017 Posted April 5, 2017 Compiling the original as x64 should do the same thing. It appears you're trying to execute 64 bit app via 32 bit compiled script. iamtheky 1
iamtheky Posted April 5, 2017 Posted April 5, 2017 not only the bitness, but maybe also the joys of Symbolic links and Junctions (I dont know I take the easy route). Easier to not troubleshoot and just turn redirection off so everything you typed is a more accurate reflection of what is actually happening, instead of magic happening mid-flight. ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
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