How to Fix: 'Avast cannot be installed (directory not empty)' Error

Dennis Faas's picture

Infopackets Reader Jerry C. writes:

" Dear Dennis,

I took your advice on antivirus and tried to install Avast! using minimal settings, but the install fails with an error message 'Avast cannot be installed into the folder you entered (directory not empty)'. I have searched for the answer to this but no one seems to know the answer. Can you help? "

My response:

I asked Jerry if he would like me to connect to his machine using my remote desktop service and he agreed.

I have not seen this error message before, and tried running the "Avast Uninstall Utility" to clean up any left-over remnants of a previous installation (which can sometimes interfere with an upgrade or new install), but this did not help. I also tried running the Avast! setup install program with administrative rights, but that did not help. Lastly I tried signing on as the Administrator user and running the setup.exe program but still received the 'Avast cannot be installed into the folder you entered (directory not empty)' error message.

How to Fix: 'Avast cannot be installed (directory not empty)' Error

After a bit of research into this problem, I found a solution: you must delete the directory where Avast! is being installed into. I am not sure how or why this happens in the first place, but the solution works. I'll detail it below:

1. To begin, click Start, then enter "CMD" (no quotes); wait for "CMD.EXE" or "Command Prompt" to appear in the list, then right click it and select "Run as Administrator".

2. Use your mouse to highlight the text below:

C:
cd C:\Program Files\
rmdir /q /s "AVAST Software"
echo this is a dummy line

3. Right click the above highlighted text, then select "Copy" from the dialogue menu. Next, go to the administrative command prompt you opened in Step #1 and right click in the middle of the window. The text you highlighted in Step #2 should now be output to the command line.

4. Download the full version of Avast! if you have not already, then double click it to run the setup.exe. The install should work without any issues.

I hope that helps.

Additional 1-on-1 Support: From Dennis

If you are still having issues installing Avast! (or uninstalling it, for that matter), I can help using my remote desktop support service. Simply contact me, briefly describing the issue and I will get back to you as soon as possible.

Got a Computer Question or Problem? Ask Dennis!

I need more computer questions. If you have a computer question -- or even a computer problem that needs fixing -- please email me with your question so that I can write more articles like this one. I can't promise I'll respond to all the messages I receive (depending on the volume), but I'll do my best.

About the author: Dennis Faas is the owner and operator of Infopackets.com. With over 30 years of computing experience, Dennis' areas of expertise are a broad range and include PC hardware, Microsoft Windows, Linux, network administration, and virtualization. Dennis holds a Bachelors degree in Computer Science (1999) and has authored 6 books on the topics of MS Windows and PC Security. If you like the advice you received on this page, please up-vote / Like this page and share it with friends. For technical support inquiries, Dennis can be reached via Live chat online this site using the Zopim Chat service (currently located at the bottom left of the screen); optionally, you can contact Dennis through the website contact form.

Rate this article: 
Average: 4.3 (6 votes)

Comments

buzzallnight's picture

I was installing Avast and doing other things at the same time.

I wanted to change the screen resolution.

I got a message similar to
we need to log you out to change the screen resolution, ok?

You cannot log out during an Avast install!!!!!!!!!!

That screwed it up and I could not uninstall it either.

I ended up doing a complete reinstall of windows.

buzzallnight's picture

Do DOS command still work in Win 10?

I though DOS was gone in win 10 replaced by linix?