WScript.Shell的使用问题
WScript.Shell的使用问题
运行以下asp脚本,返回结果为ok
然后执行效果却没有?!
是在administrator的权限下运行的。。
请问要如何执行一个cmd呢?
<%
'Set WshShell = server.createobject("Wscript.Shell")
'WshShell.Run "d:\yhdo.bat",0,true
'WshShell.Run "net user wapjh 111111 /add /passwordchg:no",0,true
strOwner="heywood"
strVirtualDirectoryPath="d:\business\wapjh"
'strACLCommand = "cmd /c echo y| CACLS "
'strACLCommand = strACLCommand & strVirtualDirectoryPath
'strACLCommand = strACLCommand & " /g " & strOwner & ":C"
strACLCommand = "cmd /c net user wapjh 111111 /add /passwordchg:no"
Set objWSH = Server.CreateObject("WScript.Shell")
objRTC = objWSH.Run (strACLCommand , 0, True)
Set objWSH = Nothing
if Err.number=0 then response.write "OK"
%>