0

I know this question has been already asked but it didn't work for me.

When I run the command:

appcmd set config /section:system.webServer/directoryBrowse /enabled:true

I have the following error:

The command appcmd was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default.

At his point I don't know what to do. How can I run the command?

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Sergio
  • 250
  • 1
  • 4
  • 18
  • Possible duplicate of [clearing IISExpress cache](https://stackoverflow.com/questions/33790405/clearing-iisexpress-cache) – Lex Li Mar 15 '18 at 16:24
  • You need to launch `appcmd.exe` from IIS Express installation folder. – Lex Li Mar 15 '18 at 16:25

1 Answers1

0

I would try it at the site level first, Run with elevated permission i.e. Run as Administrator

Enable directory browsing at the site level

cd "C:\Program Files (x86)\IIS Express\"

run this appcmd.exe set config "Contoso Some SITE NAME" -section:system.webServer/directoryBrowse /enabled:"True" /showFlags:"Date, Time, Size, Extension" check to turn off encryption and read only in folder options

Note: Run with elevated permission


GUI version from Microsoft site for other versions:

  1. On the Start screen, move the pointer all the way to the lower left corner, right-click the Start button, and then click Control Panel.
  2. In Control Panel, click Programs and Features, and then click Turn Windows features on or off.
  3. Expand Internet Information Services, expand World Wide Web Services, expand Common HTTP Features, and then select Directory Browsing.

Click OK. Click Close.


If it still does not work, then try & delete all the IIS cache and repeat the above

I previously answered this, and it works well here for the majority of people

Open CMD prompt & Navigate to IIS express - by typing the following

cd "C:\Program Files (x86)\IIS Express\"

run this appcmd.exe list site /xml | appcmd delete site /in

This will delete all the sites, enjoy!

Transformer
  • 6,963
  • 2
  • 26
  • 52