some functionality is not available in .NET class library, so we need to use one the items in the title of this thread. My question is when to refer to which one.


Actually it started with a problem. I needed to get the path for all users desktop. in vista and xp and other versions of windows OS, it is in different location and unfortunately you cant get it using specialfolder enumaration. there was one win32 method to grab all users folder but then the desktop you have to hardcode it. my manager didnt like the idea of hardcoding. so there must be a way of getting this information from the OS. i will find the solution and share in here as i do with my many questions.

i understood what windows shell API is according to definition from wikipedia
"Windows Shell[9][10]
Component of the Windows API allows applications to access the functionality provided by the operating system shell, as well as change and enhance it. The component resides in shell.dll on 16-bit Windows, and shell32.dll on 32-bit Windows. The Shell Lightweight Utility Functions are in shlwapi.dll. It is grouped under the User Interface category of the API. "
So this means it is just a programmic way of running windows shell functions, it can be thought as windows shell is a running program in windows OS, and you operate with it with your compiled code using the shell API, it is like using some program API to operate with that program like automating microsoft Excel with c#.

now it is time to understand what windows script host is all about.

ok i understood that windows shell can be thought as a subset of windows script host because windows script host can do everything windows shell can do as well as many others.
Then it will be a good idea to learn how to make use of windows script host using c#.

Microsoft currently offers three hosts for running scripting language code. They are:
Internet Explorer (IE)
Internet Information Server (IIS)
Windows Script Host (WSH, VBS)
The Internet Explorer and the Internet Information Server are well known to developers. However, many developers may not be familiar with the Windows Script Host. WSH (VBS) is a very useful tool that allows you to directly run VBScript, JScript and XML encoded scripts natively within the operating system.
Windows Script Host is the successor of batch files and enables scripts to be executed directly on the Windows desktop or command console, without the need to embed those scripts in an HTML document. Scripts can be run directly from the desktop by clicking on a script file, or from the command console. WSH provides a low-memory scripting host that is ideal for non-interactive scripting needs, such as logon scripting, administrative scripting, and so on.