Jump to content

Recommended Posts

Posted

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.

Posted

yeah, even it works when I run the command 
cmd /c   or /k from commadn prompt.

But issue with AutoIT

Posted (edited)

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

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.

Posted

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.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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
×
×
  • Create New...