使用JS
可以替代Windows安裝方式:
代碼也比較簡單:)
創建一個setup
js文件
內容為:
var fso = new ActiveXObject(
Scripting
FileSystemObject
)
var svcPath =
IIS://localhost/W
SVC/
var svcRoot = GetObject(svcPath)
var webRoot = svcRoot
GetObject(
IIsWebVirtualDir
Root
)
try
{
var objVDir
= webRoot
Create(
IIsWebVirtualDir
dbnetoffice
)
objVDir
Path = fso
GetAbsolutePathName(
)
objVDir
AppCreate(
)
objVDir
AppFriendlyName =
DotNetDemo
objVDir
SetInfo()
}
catch(ex)
{
// WScript
Echo(ex
description +
(
+ ex
number +
)
)
}
var o = new ActiveXObject(
WScript
NetWork
)
var wshShell = new ActiveXObject(
WScript
Shell
)
wshShell
Run(
iexplore
exe&//
+ o
ComputerName +
/DotNetDemo/default
aspx
)
會創建虛擬目錄DotNetDemo虛擬目錄
並且打開一個浏覽器
浏覽DotNetDemo虛擬目錄中的default
aspx文件
From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25285.html