Jump to content

Shortcut launch error


ur
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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

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

×
×
  • Create New...