You can use the AppCreate2 method of the IIsWebDirectory or IIsWebVirtualDir object to create a Web application definition and mark it as running in-process, out-of-process, or in a process pool. If an application already exists at the specified path, you can use this method to reconfigure the application to run in whatever process space you want.
DirObj.AppCreate2 InProcFlag
<%
Dim DirObj
Const INPROC = 0
Const OUTPROC = 1
Const POOLED = 2
Set DirObj = GetObject("IIS://LocalHost/W3SVC/1/ROOT/MyAppDir")
'Create an application in-process.
DirObj.AppCreate INPROC
%>
AppCreate, AppDelete, AppDeleteRecursive, AppUnload, AppUnloadRecursive, AppGetStatus, AppDisable, AppDisableRecursive, AppEnable, AppEnableRecursive, AspAppRestart