After remote desktop, target PC some shortcuts don't work, possibly loses %windir%

4

1

I ran into a problem on a PC a few months ago and have really now got to look at (partly because I thought it was due to a failing stick of RAM that was causing BSODs).

My PC runs Windows 7 x64

When I remote desktop to this PC, I noticed some of the shortcuts in my taskbar didn't work, specifically:

  • Explorer: "Can't open this item. It may have been moved, deleted..." etc
  • Visual Studio 2013: "A problem occurred... ...To fix run devenv.exe /resetsettings"
  • SSMS 2012: "Exception has been thrown by the target of the invocation"

Other shortcuts seem fine (e.g. Excel, Outlook, IE, Chrome, Firefox, Notepad++, LINQPad)

When I navigate to the actual program files (e.g. devenv.exe) and run them, the same error occurs.

So I've focused on explorer. If I run explorer.exe in the Run prompt it works. If I run the shortcut property "%windir%/explorer.exe" it says that it cannot be found. If I run "%windir%" in explorer or the Run prompt, it says it can't find it.

So I'm wondering if %windir% is the problem (for instance, do SSMS and VS have files that they refer to that use that environment variable)?

However, if I set %windir% after it disappears, the problem with starting VS and SSMS, and Explorer from the taskbar persist. So I am not sure that %windir% is the problem.

The problem is not just when connected over remote desktop. Once I have remoted to that PC, when I later return to it in person, it still has the problem. Only a log off and log on fixes it.

Any thoughts would be most appreciated.

alergy

Posted 2015-01-22T10:19:03.117

Reputation: 143

Can you please check the scheduled tasks? I know there is a remote connection logged on or something like that - maybe that is altering your settings. – cdavid – 2015-01-23T03:17:19.600

Thanks @cdavid - I've looked through the Scheduled Tasks and can't see anything that particularly jumps out. There's nothing obviously connected to Remote Connection logging on that I can see. Thanks again for the suggestion. – alergy – 2015-01-23T09:31:21.517

I've edited my answer above as I've just tried manually setting %windir% after the problem with no discernible effect on resolving the issue. – alergy – 2015-01-23T10:01:52.243

possible duplicate of Cannot resolve %windir% / Cannot modify %path% or %path% being reset on boot

– Ramhound – 2015-02-02T16:33:43.127

1I wouldn't say the question is a duplicate, but the cause and answer are in the question linked above - thanks... – alergy – 2015-02-03T12:02:21.583

Answers

5

I have been fighting with this same issue for a few months.

I finally found the answer to my situation here:

Cannot resolve %windir% / Cannot modify %path% or %path% being reset on boot

Summary of the solution: "make sure your path is < 2048 characters."

I had installed a trial version of software that added 635 total characters to my path, making it longer than 2048 total characters. Once I shortened my path, I was able to connect/disconnect without a problem.

Jonathan

Posted 2015-01-22T10:19:03.117

Reputation: 76

1Thanks so much! This fixed the issue - not sure why you were downvoted (possibly the formatting - see the edits). The remote desktop factor in this definitely complicated getting to the bottom of this, so thanks for your answer. – alergy – 2015-02-03T12:04:42.037