I.T. Discussion Community!
-Collapse +Expand
Windows
Search Windows Group:

Advanced
-Collapse +Expand Windows Store
PRESTWOODSTORE

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► KBIT Water-Coo...Windows Users   Print This     
 
Windows Users:
The Infamous Path Bug
 
Posted 5 years ago on 2/4/2015 and updated 5/14/2016
Take Away:

Error: Exception has been thrown by target of an invocation.

Solution: Shorten the path of the environmental variable, run SystemPropertiesAdvanced.exe 

KB102720

"Exception has been thrown by target of an invocation." is a near-useless error message that pops up, primarily for developers.

The cause of this problem can produce other symptoms, like shortcuts losing their icons with the result that, say, Notepad shows a generic icon instead of it's more helpful notepad-like icon.

It can take quite a bit of Internet searching to find the solution, so here's what many of us have found to work; to fix the problem.

Remember the old PATH environment variable from the days of DOS?  Well, it's still with us and it has a limitation that makes it what I call a bug. (I've confirmed the problem in Windows 7, but not yet in Windows 8)

The PATH variable is limited to 2,048 characters and, when that limit is exceeded, Windows may temporarily trim it down to almost nothing. When that happens, Windows can't find all the files that the PATH is supposed to help it find.

This bug afflicts mainly developers because of all the programs and tools that we need to install. Each installed program may add one or more terms to the PATH and, when the path grows beyond 2,048 characters, Windows can seem to lose it's mind.

The solution is to shorten the PATH and then reboot.

To shorten the path, run this program: SystemPropertiesAdvanced.exe (You many have to do some searching to find it)

This will either display an over-sized PATH or a very abbreviated PATH. If the latter, just reboot; that should fix your problem but you may then have to rebuild your PATH.  If the former, carefully remove some of the terms (what you see between semi-colons) in the PATH, save and reboot.

Here's a pretty good blog post about the problem: http://www.dirkstrauss.com/programming/exception-thrown-target-invocation#.VNJF_Z3F-Sp


Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P147A1
Enter key:
KB Post Contributed By Wes Peterson:

Wes Peterson is a Senior Programmer Analyst with Prestwood IT Solutions where he develops custom Windows software and custom websites using .Net and Delphi. When Wes is not coding for clients, he participates in this online community. Prior to his 10-year love-affair with Delphi, he worked with several other tools and databases. Currently he specializes in VS.Net using C# and VB.Net. To Wes, the .NET revolution is as exciting as the birth of Delphi.

Visit Profile

 KB Article #102720 Counter
4338
Since 2/4/2015

Follow PrestwoodBoards on: 


©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech