System cannot find the path specified

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

System cannot find the path specified

Post by RussF » 21 Jan 2022, 13:29

I've run into a really strange situation and although I have found a work-around, I was wondering if anyone else has had this experience and/or could explain why it's happening.

I have always been able to use ahk to run shortcut links from my desktop. I have found one, however, that won't work.

Code: Select all

Run, "D:\Russ\Desktop\Tera Term.lnk"            	;<-- Works
Run, "D:\Russ\Desktop\OE Classic.lnk"           	;<-- Works
Run, "D:\Russ\Desktop\Global VPN Client.lnk"    	;<-- Doesn't work
Note that I have remapped my desktop library to another drive, but that should be irrelevant. In each case, I Shift-Right-Clicked on the shortcut and selected "Copy as path" to get the exact location of the shortcut.

The error I get is:
image.png
image.png (11.43 KiB) Viewed 572 times
There are no other lines in the script.
I have tried #NoEnv.
I have renamed the shortcut with and without spaces.
I have moved the shortcut to another drive and folder (and renamed it there as well).
I have recreated the shortcut from the original exe.
I have tried running as administrator.
None of these tactics work.

I can type "D:\Russ\Desktop\Global VPN Client.lnk" (with the quotes) at a command prompt logged into drive C:\ and it works.
I copied the exact contents of the "Target:" and "Start in:" fields of the shortcut to create

Code: Select all

Run, "C:\Program Files\SonicWall\Global VPN Client\SWGVC.exe", "C:\Program Files\SonicWall\Global VPN Client\"
and that works fine as well.
The only attribute set on the shortcut is the archive bit.
I can't find anything different in the properties of the shortcut compared to the ones that work.
This is not one of those hidden apps like Calculator.

So, as I said, I can use the second option to run the executable, but I spent this time just trying to figure out "WHY" with no luck, and was just wondering if anyone knows what's going on?

Russ

User avatar
JoeWinograd
Posts: 2185
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: System cannot find the path specified

Post by JoeWinograd » 21 Jan 2022, 13:57

Hi @RussF,

Smells a lot like this issue:

viewtopic.php?f=76&t=88473

Regards, Joe

RussF
Posts: 1242
Joined: 05 Aug 2021, 06:36

Re: System cannot find the path specified

Post by RussF » 21 Jan 2022, 14:54

Joe, you're absolutely right - it is exactly that problem. I remember reading that thread (almost a year ago now), but I searched for the error message and since it was never quoted in the thread, it didn't pick it up.

The shortcut points to a 64 bit exe, but I have 32 bit ahk installed because we still have quite a few 32 bit pc's in our environment and I want to be sure that any script I compile will run on either flavor.

I grabbed ShellRun() and it worked like a champ (thanks @lexikos ).

Will that work generically, in other words, can I use that as a replacement for "Run" in a 32 bit compiled script to run any app or only 64 bit apps? Working from home right now and don't have access to a 32 bit machine to test it. Will have to give it a try.

Thanks again Joe,

Russ

User avatar
JoeWinograd
Posts: 2185
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: System cannot find the path specified

Post by JoeWinograd » 21 Jan 2022, 15:12

Hi Russ,

> I grabbed ShellRun() and it worked like a champ (thanks @lexikos ).

I'm glad that worked for you.

> I want to be sure that any script I compile will run on either flavor

Same here!

> can I use that as a replacement for "Run" in a 32 bit compiled script to run any app or only 64 bit apps?

Yes, you may use it as a replacement for Run. Problem is, there is no equivalent for RunWait, as discussed in this thread:
viewtopic.php?f=76&t=96969

> Will have to give it a try.

Should work fine.

> Thanks again Joe,

Pleasure! Regards, Joe

Post Reply

Return to “Ask for Help (v1)”