Author Topic: Weird behavior of Windows after installing - rundll32.exe cannot be found  (Read 8631 times)

0 Members and 1 Guest are viewing this topic.

Offline ipsecog

  • Heavy QuantumATK user
  • ***
  • Posts: 35
  • Country: se
  • Reputation: 0
    • View Profile
I installed the latest beta-version of ATK, but I wasn't able to launch it, it complained about the license. So I wanted to open the Control Panel to check the environment variables, but lo and behold - I got a very weird error message:

Windows cannot find '%windir%\system32\rundll32.exe'. Make sure you typed the name correctly, and then try again.

This is very odd - the file is actually there! I tried to Google about it but those results are all about viruses and corrupted files, I don't think that's the case for me at all.

Any ideas?
« Last Edit: September 19, 2013, 11:14 by ipsecog »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
I had that error too once, and the cause is simple but very hard to guess. It's caused by the PATH being too long! The PATH on Windows 7 or 8 can be very long - but not very, very long, so it's a good idea to prune it once in a while.

Now, it can actually be hard to fix this because one of the things that you can't do in this situation is open the Control Panel (which is where normally you would edit the PATH)... :/

One solution is to open "regedit" (be warned, you can do serious system damage there, so promise to be careful), and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. There you can edit the system PATH variable (there is also a user PATH variable, but at least ATK uses the system one).

I also found out it's possible to use "setx" from the command line. However, setx can only include the first 1024 characters of the path, so this needs to be a two-step process (since your path is too long, it's definitely longer than 1024).

1) Open a terminal ("cmd").
2) Execute echo %PATH% > savepath.txt.
3) Open the created file savepath.txt in e.g. Notepad, and first of all check that it does contain the current PATH - you don't want to lose this information!
4) Remove unnecessary entries in the PATH to make it shorter. Note that there should be no line breaks - all should be on one single line!
5) Copy the text to the clipboard.
6) Go back to the terminal window and type

setx /m PATH "C:\"

NOTE: This destroys your whole PATH variable - but the purpose here is just to be able to open the Control Panel!

At this point you should be able to open the Control Panel and go to System>Advanced system settings>Environment variables, and paste the full, edited path into place.